]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a potential endless function call loop in platform code
authorMario <mario@smbclan.net>
Wed, 15 Mar 2017 02:34:42 +0000 (12:34 +1000)
committerMario <mario@smbclan.net>
Wed, 15 Mar 2017 02:34:42 +0000 (12:34 +1000)
qcsrc/common/triggers/subs.qc

index 67eb18a6782b84f54abedd8813e258c51b846fb4..b7cea323d59f4da36c1ab74dffd11bf9796004ca 100644 (file)
@@ -87,7 +87,7 @@ void SUB_CalcMoveDone(entity this)
        SUB_SETORIGIN (this, this.finaldest);
        this.SUB_VELOCITY = '0 0 0';
        this.SUB_NEXTTHINK = -1;
-       if (this.think1)
+       if (this.think1 && this.think1 != SUB_CalcMoveDone)
                this.think1 (this);
 }
 
@@ -310,7 +310,7 @@ void SUB_CalcAngleMoveDone(entity this)
        this.angles = this.finalangle;
        this.SUB_AVELOCITY = '0 0 0';
        this.SUB_NEXTTHINK = -1;
-       if (this.think1)
+       if (this.think1 && this.think1 != SUB_CalcAngleMoveDone) // avoid endless loops
                this.think1 (this);
 }