#include "subs.qh"
+
void SUB_NullThink(entity this) { }
void SUB_CalcMoveDone(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
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)
{
// 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;
// 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
{
delete(this.move_controller);
}
- controller = new(SUB_CalcMove_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;
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);
}
this.lodmodel1 = this.lodmodel2 = ""; // don't even initialize
}
- if(this.lodmodel1 != "")
+ if(this.lodmodel1 != "" && fexists(this.lodmodel1))
{
vector mi, ma;
mi = this.mins;
_setmodel(this, this.lodmodel1);
this.lodmodelindex1 = this.modelindex;
- if(this.lodmodel2 != "")
+ if(this.lodmodel2 != "" && fexists(this.lodmodel2))
{
precache_model(this.lodmodel2);
_setmodel(this, this.lodmodel2);