func_door: 'netname' trigger happens when door returns to its original

position, not the other way around.
This commit is contained in:
Marco Cawthorne 2022-01-03 19:27:47 -08:00
parent 3726139eda
commit df2a385bbd
Signed by: eukara
GPG key ID: C196CD8BA993248A

View file

@ -156,14 +156,6 @@ func_door::Arrived(void)
sound(this, CHAN_VOICE, "common/null.wav", 1.0f, ATTN_NORM);
}
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 (!(spawnflags & SF_MOV_USE)) {
touch = Touch;
}
@ -184,6 +176,14 @@ func_door::Returned(void)
velocity = [0,0,0];
nextthink = 0.0f;
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 (m_strSndStop) {
Sound_Play(this, CHAN_VOICE, m_strSndStop);
} else {