-void SUB_Null() {}
-float SUB_True() { return 1; }
-float SUB_False() { return 0; }
+void SUB_NullThink(void) { }
void() SUB_CalcMoveDone;
void() SUB_CalcAngleMoveDone;
//print(ftos(time), " -> ", ftos(e.frame), "\n");
}
-vector animfixfps(entity e, vector a)
-{
- // multi-frame anim: keep as-is
- if(a_y == 1)
- {
- float dur;
- dur = frameduration(e.modelindex, a_x);
- if(dur > 0)
- a_z = 1.0 / dur;
- }
- return a;
-}
-
/*
==================
SUB_Remove
*/
void SUB_VanishOrRemove (entity ent)
{
- if (ent.flags & FL_CLIENT)
+ if (IS_CLIENT(ent))
{
// vanish
ent.alpha = -1;
*/
void SUB_SetFade (entity ent, float when, float fadetime)
{
- //if (ent.flags & FL_CLIENT) // && ent.deadflag != DEAD_NO)
- // return;
- //ent.alpha = 1;
ent.fade_rate = 1/fadetime;
ent.think = SUB_SetFade_Think;
ent.nextthink = when;
vector delta;
vector delta2;
vector veloc;
- vector adelta;
+ vector angloc;
vector nextpos;
delta = self.destvec;
delta2 = self.destvec2;
vector destangle;
destangle = delta + 2 * delta2 * phasepos;
destangle = vectoangles(destangle);
- destangle_x = -destangle_x;
+ destangle_x = -destangle_x; // flip up / down orientation
// take the shortest distance for the angles
self.owner.angles_x -= 360 * floor((self.owner.angles_x - destangle_x) / 360 + 0.5);
self.owner.angles_y -= 360 * floor((self.owner.angles_y - destangle_y) / 360 + 0.5);
self.owner.angles_z -= 360 * floor((self.owner.angles_z - destangle_z) / 360 + 0.5);
- adelta = destangle - self.owner.angles; // flip up / down orientation
+ angloc = destangle - self.owner.angles;
+ angloc = angloc * (1 / sys_frametime); // so it arrives for the next frame
+ self.owner.avelocity = angloc;
}
- if(nexttick < self.animstate_endtime) {
+ if(nexttick < self.animstate_endtime)
veloc = nextpos - self.owner.origin;
- veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
- } else {
+ else
veloc = self.finaldest - self.owner.origin;
- veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
- }
+ veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
+
self.owner.velocity = veloc;
- self.owner.avelocity = adelta;
self.nextthink = nexttick;
} else {
// derivative: delta + 2 * delta2 (e.g. for angle positioning)
controller.think1 = self.think;
// the thinking is now done by the controller
- self.think = SUB_Null;
+ self.think = SUB_NullThink; // for PushMove
self.nextthink = self.ltime + traveltime;
// invoke controller
// check whether antilagged traces are enabled
if (lag < 0.001)
lag = 0;
- if (clienttype(forent) != CLIENTTYPE_REAL)
+ if not(IS_REAL_CLIENT(forent))
lag = 0; // only antilag for clients
// change shooter to SOLID_BBOX so the shot can hit corpses
if(self.model != "")
{
precache_model(self.model);
- setmodel(self, self.model); // no precision needed
+ if(self.mins != '0 0 0' || self.maxs != '0 0 0')
+ {
+ vector mi = self.mins;
+ vector ma = self.maxs;
+ setmodel(self, self.model); // no precision needed
+ setsize(self, mi, ma);
+ }
+ else
+ setmodel(self, self.model); // no precision needed
InitializeEntity(self, LODmodel_attach, INITPRIO_FINDTARGET);
}
setorigin(self, self.origin);
if(self.model != "")
{
precache_model(self.model);
- setmodel(self, self.model); // no precision needed
+ if(self.mins != '0 0 0' || self.maxs != '0 0 0')
+ {
+ vector mi = self.mins;
+ vector ma = self.maxs;
+ setmodel(self, self.model); // no precision needed
+ setsize(self, mi, ma);
+ }
+ else
+ setmodel(self, self.model); // no precision needed
}
setorigin(self, self.origin);
ApplyMinMaxScaleAngles(self);