scripted_sequence & multi_manager: Mark both their return values as positive once they've triggered their targets only.
This commit is contained in:
parent
f9c7807c1f
commit
299b2eed72
4 changed files with 14 additions and 3 deletions
|
@ -198,6 +198,7 @@ multi_manager::Trigger(entity act, int state)
|
|||
dprint(sprintf("^2%s::^3Trigger^7: %s (%s)\n",
|
||||
this.classname, wow.target, eFind.classname));
|
||||
|
||||
m_iValue = TRUE;
|
||||
UseTargets(wow.m_eActivator, TRIG_TOGGLE, 0.0f);
|
||||
}
|
||||
|
||||
|
@ -221,8 +222,8 @@ multi_manager::Trigger(entity act, int state)
|
|||
continue;
|
||||
|
||||
m_eTriggers[i].think = mm_enttrigger;
|
||||
m_eTriggers[i].m_iValue = FALSE;
|
||||
m_eTriggers[i].nextthink = time + m_eTriggers[i].m_flUntilTriggered;
|
||||
m_eTriggers[i].m_iValue = TRUE;
|
||||
m_eTriggers[i].m_eActivator = act;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,13 +187,16 @@ scripted_sequence::RunOnEntity(entity targ)
|
|||
if (target) {
|
||||
dprint(sprintf("\tTrigger when finished: %s\n", target));
|
||||
f.m_strRouteEnded = target;
|
||||
f.m_ssLast = this;
|
||||
m_iValue = FALSE; /* will be marked as used once triggered */
|
||||
} else {
|
||||
/* make sure we're not about to trigger _anything_ */
|
||||
f.m_strRouteEnded = __NULL__;
|
||||
f.m_ssLast = __NULL__;
|
||||
/* mark us as having been used, for multisources. */
|
||||
m_iValue = TRUE;
|
||||
}
|
||||
|
||||
/* mark us as having been used, for multisources. */
|
||||
m_iValue = TRUE;
|
||||
|
||||
/* mark the state */
|
||||
f.m_iSequenceState = SEQUENCESTATE_ACTIVE;
|
||||
|
|
|
@ -183,6 +183,7 @@ typedef enum
|
|||
class NSMonster:NSSurfacePropEntity
|
||||
{
|
||||
#ifdef SERVER
|
||||
entity m_ssLast;
|
||||
vector oldnet_velocity;
|
||||
float m_flPitch;
|
||||
int m_iFlags;
|
||||
|
|
|
@ -338,11 +338,17 @@ NSMonster::FreeState(void)
|
|||
m_iSequenceState = SEQUENCESTATE_NONE;
|
||||
m_iSequenceFlags = 0;
|
||||
|
||||
if (m_ssLast) {
|
||||
scripted_sequence seq = (scripted_sequence)m_ssLast;
|
||||
seq.m_iValue = TRUE;
|
||||
}
|
||||
|
||||
/* we're clearing m_strRouteEnded early, because m_strRouteEnded
|
||||
might change when .Trigger is executed. It could be another scripted
|
||||
sequence triggering another sequence. Hence the caching */
|
||||
to_trigger = m_strRouteEnded;
|
||||
m_strRouteEnded = __NULL__;
|
||||
m_ssLast = __NULL__;
|
||||
|
||||
/* trigger when required */
|
||||
if (to_trigger) {
|
||||
|
|
Loading…
Reference in a new issue