func_door_rotating: Lock doors when a targetname is set, as doors then can only be opened by triggers

This commit is contained in:
Marco Cawthorne 2019-01-16 05:17:52 +01:00
parent d88c441f27
commit 1c009a189e

View file

@ -23,6 +23,7 @@ class func_door_rotating:CBaseTrigger
int m_iMoveSnd;
int m_iStopSnd;
int m_iDamage;
int m_iLocked;
float m_flDistance;
float m_flSpeed;
float m_flLip;
@ -188,6 +189,10 @@ void func_door_rotating::Touch(void)
return;
}
if (m_iLocked) {
return;
}
if (other.movetype == MOVETYPE_WALK) {
if (other.absmin[2] <= maxs[2] - 2) {
eActivator = other;
@ -296,6 +301,10 @@ void func_door_rotating::Respawn(void)
//m_vecMoveDir = m_vecMoveDir * -1;
}
if (m_strTargetName) {
m_iLocked = TRUE;
}
angles = m_vecPos1;
}