func_door: Fix targetClose
not getting triggered right when START_OPEN spawnflag is set
This commit is contained in:
parent
c0b031ed9f
commit
9c66c2c5f9
1 changed files with 14 additions and 7 deletions
|
@ -416,16 +416,23 @@ func_door::MoverFinishesMoving(void)
|
|||
MoveToPosition(GetMoverPosition1(), m_flSpeed);
|
||||
}
|
||||
|
||||
/* we arrived at our starting position within the map */
|
||||
if (GetMoverState() == MOVER_POS1) {
|
||||
if (targetClose)
|
||||
for (entity f = world; (f = find(f, ::targetname, targetClose));) {
|
||||
NSEntity trigger = (NSEntity)f;
|
||||
if (trigger.Trigger != __NULL__) {
|
||||
trigger.Trigger(this, TRIG_TOGGLE);
|
||||
|
||||
if (targetClose && targetClose != "") {
|
||||
/* when it starts open the positions are reversed... */
|
||||
if (GetMoverState() == MOVER_POS1 ||
|
||||
(HasSpawnFlags(SF_MOV_OPEN) && GetMoverState() == MOVER_POS2)) {
|
||||
for (entity f = world; (f = find(f, ::targetname, targetClose));) {
|
||||
NSEntity trigger = (NSEntity)f;
|
||||
if (trigger.Trigger != __NULL__) {
|
||||
trigger.Trigger(this, TRIG_TOGGLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* we arrived at our starting position within the map */
|
||||
if (GetMoverState() == MOVER_POS1) {
|
||||
if (m_strSndStop) {
|
||||
StartSoundDef(m_strSndStop, CHAN_VOICE, true);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue