]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/subs.qc
Merge branch 'Mario/monster_lod_models' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / subs.qc
index ed5ec9f9025018b3545aa525f295d062c59685c0..31ffee064fb361df3522cb3586723a7a79242e25 100644 (file)
@@ -9,7 +9,7 @@ void SUB_CalcAngleMoveDone(entity this);
 spawnfunc(info_null)
 {
        delete(this);
-       // if anything breaks, tell the mapper to fix his map! info_null is meant to remove itself immediately.
+       // if anything breaks, tell the mapper to fix their map! info_null is meant to remove itself immediately.
 }
 #endif
 
@@ -102,6 +102,12 @@ void SUB_CalcMoveDone(entity this)
                this.think1 (this);
 }
 
+void SUB_CalcMovePause(entity this)
+{
+       this.move_controller.animstate_starttime += frametime;
+       this.move_controller.animstate_endtime += frametime;
+}
+
 .float platmovetype_turn;
 void SUB_CalcMove_controller_think (entity this)
 {
@@ -169,7 +175,8 @@ void SUB_CalcMove_controller_setbezier (entity controller, vector org, vector co
        // 2 * control * t - 2 * control * t * t + destin * t * t
        // 2 * control * t + (destin - 2 * control) * t * t
 
-       setorigin(controller, org);
+       //setorigin(controller, org); // don't link to the world
+       controller.origin = org;
        control -= org;
        destin -= org;
 
@@ -184,7 +191,8 @@ void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector de
        // 2 * control * t - 2 * control * t * t + destin * t * t
        // 2 * control * t + (destin - 2 * control) * t * t
 
-       setorigin(controller, org);
+       //setorigin(controller, org); // don't link to the world
+       controller.origin = org;
        destin -= org;
 
        controller.destvec = destin; // end point
@@ -233,6 +241,7 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
                delete(this.move_controller);
        }
        controller = new_pure(SUB_CalcMove_controller);
+       set_movetype(controller, MOVETYPE_NONE); // mark the entity as physics driven so that thinking is handled by QC
        controller.owner = this;
        this.move_controller = controller;
        controller.platmovetype = this.platmovetype;
@@ -396,7 +405,7 @@ void ApplyMinMaxScaleAngles(entity e)
                e.mins_y = -e.maxs.x;
        }
        if(e.scale)
-               setsize(e, e.mins * e.scale, e.maxs * e.scale);
+               setsize(e, RoundPerfectVector(e.mins * e.scale), RoundPerfectVector(e.maxs * e.scale));
        else
                setsize(e, e.mins, e.maxs);
 }