From: Mario Date: Thu, 11 Oct 2018 03:11:10 +0000 (+1000) Subject: Don't allow a trigger to target itself (infinite loops tend to be crashy) X-Git-Tag: xonotic-v0.8.5~1785 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c7c5ccc515d06ba849f60a5504ec186672689e1;p=xonotic%2Fxonotic-data.pk3dir.git Don't allow a trigger to target itself (infinite loops tend to be crashy) --- diff --git a/qcsrc/common/mapobjects/triggers.qc b/qcsrc/common/mapobjects/triggers.qc index 940eb3212..9a7181d3a 100644 --- a/qcsrc/common/mapobjects/triggers.qc +++ b/qcsrc/common/mapobjects/triggers.qc @@ -304,7 +304,7 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe { for(entity t = NULL; (t = find(t, targetname, s)); ) { - if(t.use && (t.sub_target_used != time || !preventReuse)) + if(t != this && t.use && (t.sub_target_used != time || !preventReuse)) { if(this.target_random) {