]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 940eb32120944a4643a758e50ab8097178c2d72d..9a7181d3a2250a530466a1d3dcbf59a9e9d1f0d8 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)
                                        {