void set_movetype(entity this, int mt)
{
this.move_movetype = mt;
- if (mt == MOVETYPE_PHYSICS /*|| mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH*/) {
+ if (mt == MOVETYPE_PHYSICS) {
this.move_qcphysics = false;
}
if(!IL_CONTAINS(g_moveables, this))
if(dt <= 0)
return 0;
- int blocked = 0;
+ int blockedflag = 0;
int i, j, numplanes = 0;
float time_left = dt, grav = 0;
vector push;
{
// we got teleported by a touch function
// let's abort the move
- blocked |= 8;
+ blockedflag |= 8;
break;
}
if(trace_plane_normal.z > 0.7)
{
// floor
- blocked |= 1;
+ blockedflag |= 1;
if(!trace_ent)
{
if(!_Movetype_PushEntity(this, steppush, true, false))
{
- blocked |= 8;
+ blockedflag |= 8;
break;
}
if(!_Movetype_PushEntity(this, push, true, false))
{
- blocked |= 8;
+ blockedflag |= 8;
break;
}
float trace2_fraction = trace_fraction;
steppush = vec3(0, 0, org.z - this.origin_z);
if(!_Movetype_PushEntity(this, steppush, true, false))
{
- blocked |= 8;
+ blockedflag |= 8;
break;
}
else
{
// step - return it to caller
- blocked |= 2;
+ blockedflag |= 2;
// save the trace for player extrafriction
if(applystepnormal)
move_stepnormal = trace_plane_normal;
{
// this shouldn't really happen
this.velocity = '0 0 0';
- blocked = 3;
+ blockedflag = 3;
break;
}
if(numplanes != 2)
{
this.velocity = '0 0 0';
- blocked = 7;
+ blockedflag = 7;
break;
}
vector dir = cross(planes[0], planes[1]);
}
// LordHavoc: this came from QW and allows you to get out of water more easily
- if(GAMEPLAYFIX_EASIERWATERJUMP(this) && (this.flags & FL_WATERJUMP) && !(blocked & 8))
+ if(GAMEPLAYFIX_EASIERWATERJUMP(this) && (this.flags & FL_WATERJUMP) && !(blockedflag & 8))
this.velocity = primal_velocity;
- if(PHYS_WALLCLIP(this) && this.pm_time && !(this.flags & FL_WATERJUMP) && !(blocked & 8))
+ if(PHYS_WALLCLIP(this) && this.pm_time && !(this.flags & FL_WATERJUMP) && !(blockedflag & 8))
this.velocity = primal_velocity;
if(applygravity)
}
}
- return blocked;
+ return blockedflag;
}
void _Movetype_CheckVelocity(entity this) // SV_CheckVelocity
return (this.origin == last_origin); // false if teleported by touch
}
-
-.float ltime;
-.void() blocked;
-
void _Movetype_Physics_Frame(entity this, float movedt)
{
this.move_didgravity = -1;
{
this.origin = this.origin + dt * this.velocity;
this.angles = this.angles + dt * this.avelocity;
- this.angles_x -= 360.0 * floor(this.angles_x) * (1.0 / 360.0);
- this.angles_y -= 360.0 * floor(this.angles_y) * (1.0 / 360.0);
- this.angles_z -= 360.0 * floor(this.angles_z) * (1.0 / 360.0);
+ this.angles_x -= 360.0 * floor(this.angles_x * (1.0 / 360.0));
+ this.angles_y -= 360.0 * floor(this.angles_y * (1.0 / 360.0));
+ this.angles_z -= 360.0 * floor(this.angles_z * (1.0 / 360.0));
this.ltime += dt;
_Movetype_LinkEdict(this, false);
return;
if(this.move_movetype == MOVETYPE_FAKEPUSH) // Tenebrae's MOVETYPE_PUSH variant that doesn't push...
{
- this.angles_x -= 360.0 * floor(this.angles_x) * (1.0 / 360.0);
- this.angles_y -= 360.0 * floor(this.angles_y) * (1.0 / 360.0);
- this.angles_z -= 360.0 * floor(this.angles_z) * (1.0 / 360.0);
+ this.angles_x -= 360.0 * floor(this.angles_x * (1.0 / 360.0));
+ this.angles_y -= 360.0 * floor(this.angles_y * (1.0 / 360.0));
+ this.angles_z -= 360.0 * floor(this.angles_z * (1.0 / 360.0));
return;
}
}
// try moving the contacted entity
- int savesolid = it.solid;
- it.solid = SOLID_NOT;
+ int savesolid = this.solid;
+ this.solid = SOLID_NOT;
if(!_Movetype_PushEntity(it, move, true, false))
{
// entity "check" got teleported
it.angles_y += trace_fraction * moveangle.y;
- it.solid = savesolid;
+ this.solid = savesolid;
continue; // pushed enough
}
// FIXME: turn players specially
it.angles_y += trace_fraction * moveangle.y;
- it.solid = savesolid;
+ this.solid = savesolid;
// this trace.fraction < 1 check causes items to fall off of pushers
// if they pass under or through a wall
break;
}
});
- this.angles_x -= 360.0 * floor(this.angles_x) * (1.0 / 360.0);
- this.angles_y -= 360.0 * floor(this.angles_y) * (1.0 / 360.0);
- this.angles_z -= 360.0 * floor(this.angles_z) * (1.0 / 360.0);
+ this.angles_x -= 360.0 * floor(this.angles_x * (1.0 / 360.0));
+ this.angles_y -= 360.0 * floor(this.angles_y * (1.0 / 360.0));
+ this.angles_z -= 360.0 * floor(this.angles_z * (1.0 / 360.0));
IL_CLEAR(g_pushmove_moved); // clean up
}
if(movetime)
{
// advances this.ltime if not blocked
- _Movetype_PushMove(this, dt);
+ _Movetype_PushMove(this, movetime);
}
if(this.nextthink > oldltime && this.nextthink <= this.ltime)
IL_EACH(g_moveables, true,
{
- if(IS_CLIENT(it) || it.classname == "" /*|| it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH*/ || it.move_movetype == MOVETYPE_PHYSICS)
+ if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PHYSICS)
continue;
//set_movetype(it, it.move_movetype);
IL_EACH(g_moveables, it.move_qcphysics,
{
- if(IS_CLIENT(it) || is_pure(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE)
+ if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE)
continue;
Movetype_Physics_NoMatchTicrate(it, PHYS_INPUT_TIMELENGTH, false);
});