Don't allow a trigger to target itself (infinite loops tend to be crashy)
authorMario <mario@smbclan.net>
Thu, 11 Oct 2018 03:11:10 +0000 (13:11 +1000)
committerMario <mario@smbclan.net>
Thu, 11 Oct 2018 03:11:10 +0000 (13:11 +1000)
qcsrc/common/mapobjects/triggers.qc

index 940eb32..9a7181d 100644 (file)
@@ -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)
                                        {