]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/subs.qc
Move an assault constant into the assault file
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / subs.qc
index 5b6182e0ab8574877e11f8432a316bcf41e94aa3..2a237fdcb79abdb5be234fd7e65b0dd4512134c4 100644 (file)
@@ -145,6 +145,8 @@ void SUB_CalcMove_controller_think (entity this)
                // derivative: delta + 2 * delta2 (e.g. for angle positioning)
                entity own = this.owner;
                setthink(own, this.think1);
+               // set the owner's reference to this entity to NULL
+               own.move_controller = NULL;
                delete(this);
                getthink(own)(own);
        }
@@ -220,8 +222,14 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
                return;
        }
 
+       // delete the previous controller, otherwise changing movement midway is glitchy
+       if (this.move_controller != NULL)
+       {
+               delete(this.move_controller);
+       }
        controller = new(SUB_CalcMove_controller);
        controller.owner = this;
+       this.move_controller = controller;
        controller.platmovetype = this.platmovetype;
        controller.platmovetype_start = this.platmovetype_start;
        controller.platmovetype_end = this.platmovetype_end;