mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Safely check if other is NULL when triggering
This commit is contained in:
parent
1ea273fba0
commit
1a71d44b43
1 changed files with 12 additions and 0 deletions
|
@ -440,6 +440,12 @@ void Trigger::TriggerStuff(Event *ev)
|
|||
ScriptError("trigger '%s' triggered by self", TargetName().c_str());
|
||||
}
|
||||
|
||||
// Fixed in OPM
|
||||
// Safety check
|
||||
if (other == NULL) {
|
||||
ScriptError("trigger '%s' triggered by NULL entity", TargetName().c_str());
|
||||
}
|
||||
|
||||
// Always respond to activate messages from the world since they're probably from
|
||||
// the "trigger" command
|
||||
if (!respondTo(other) && (other != world || *ev != EV_Activate)
|
||||
|
@ -894,6 +900,12 @@ void TriggerAll::TriggerStuff(Event *ev)
|
|||
ScriptError("trigger '%s' triggered by self", TargetName().c_str());
|
||||
}
|
||||
|
||||
// Fixed in OPM
|
||||
// Safety check
|
||||
if (other == NULL) {
|
||||
ScriptError("trigger '%s' triggered by NULL entity", TargetName().c_str());
|
||||
}
|
||||
|
||||
// Always respond to activate messages from the world since they're probably from
|
||||
// the "trigger" command
|
||||
if (!respondTo(other) && !((other == world) && (*ev == EV_Activate))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue