if (this.count & 0x80)
{
- // this.flags &= ~FL_ONGROUND;
+ // UNSET_ONGROUND(this);
if (this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FLY)
Movetype_Physics_NoMatchServer(this);
// the trivial movetypes do not have to match the
// moving, we might still be ticrate dependent.
else
Movetype_Physics_MatchServer(this, autocvar_cl_projectiles_sloppy);
- if (!(this.flags & FL_ONGROUND))
+ if (!IS_ONGROUND(this))
if (this.velocity != '0 0 0')
this.angles = vectoangles(this.velocity);
}
// projectiles no longer being able to lie on a bmodel
this.move_nomonsters = MOVE_WORLDONLY;
if (f & 0x40)
- this.flags |= FL_ONGROUND;
+ SET_ONGROUND(this);
else
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
if (!this.move_time)
{
void Casing_Draw(entity this)
{
- if (this.flags & FL_ONGROUND)
+ if (IS_ONGROUND(this))
{
this.angles_x = 0;
this.angles_z = 0;
if (thisforce.z < 0)
thisforce.z = 0;
this.velocity = this.velocity + thisforce + '0 0 100';
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
}
NET_HANDLE(casings, bool isNew)
if(vdist(thisforce, !=, 0))
{
it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, autocvar_g_balance_damagepush_speedfactor);
- it.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(it);
}
if(w_issilent)
this.move_didgravity = 1;
grav = dt * (PHYS_ENTGRAVITY(this) ? PHYS_ENTGRAVITY(this) : 1) * PHYS_GRAVITY(this);
- if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !(this.flags & FL_ONGROUND))
+ if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !IS_ONGROUND(this))
{
if(GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE)
this.velocity_z -= grav * 0.5;
trace_ent = NULL;
}
- this.flags |= FL_ONGROUND;
+ SET_ONGROUND(this);
this.move_groundentity = trace_ent;
}
}
if(applygravity)
{
- if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !(this.flags & FL_ONGROUND))
+ if(!GAMEPLAYFIX_NOGRAVITYONGROUND || !IS_ONGROUND(this))
{
if(GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE)
this.velocity_z -= grav * 0.5f;
this.origin = trace_endpos;
if(trace_fraction < 1)
- if(this.solid >= SOLID_TRIGGER && (!(this.flags & FL_ONGROUND) || (this.move_groundentity != trace_ent)))
+ if(this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || (this.move_groundentity != trace_ent)))
_Movetype_Impact(this, trace_ent);
return trace_fraction;
this.move_time += n * tr;
if(!this.move_didgravity)
- this.move_didgravity = ((this.move_movetype == MOVETYPE_BOUNCE || this.move_movetype == MOVETYPE_TOSS) && !(this.flags & FL_ONGROUND));
+ this.move_didgravity = ((this.move_movetype == MOVETYPE_BOUNCE || this.move_movetype == MOVETYPE_TOSS) && !IS_ONGROUND(this));
for (int i = 0; i < n; ++i)
{
}
- if(dt > 0 && this.move_movetype != MOVETYPE_NONE && !(this.flags & FL_ONGROUND))
+ if(dt > 0 && this.move_movetype != MOVETYPE_NONE && !IS_ONGROUND(this))
{
// now continue the move from move_time to time
void _Movetype_Physics_Step(entity this, float dt) // SV_Physics_Step
{
- if(this.flags & FL_ONGROUND)
+ if(IS_ONGROUND(this))
{
if(this.velocity_z >= (1.0 / 32.0) && UPWARD_VELOCITY_CLEARS_ONGROUND(this))
{
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
_Movetype_CheckVelocity(this);
_Movetype_FlyMove(this, dt, true, '0 0 0', 0);
_Movetype_LinkEdict(this, true);
void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss
{
- if (this.flags & FL_ONGROUND)
+ if (IS_ONGROUND(this))
{
if (this.velocity.z >= 1 / 32 && UPWARD_VELOCITY_CLEARS_ONGROUND(this))
{
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
}
else if (!this.move_groundentity)
{
if (this.move_movetype == MOVETYPE_BOUNCEMISSILE)
{
this.velocity = _Movetype_ClipVelocity(this.velocity, trace_plane_normal, 2.0);
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
}
else if (this.move_movetype == MOVETYPE_BOUNCE)
{
float d = trace_plane_normal * this.velocity;
if (trace_plane_normal.z > 0.7 && d < bstop && d > -bstop)
{
- this.flags |= FL_ONGROUND;
+ SET_ONGROUND(this);
this.move_groundentity = trace_ent;
this.velocity = '0 0 0';
this.avelocity = '0 0 0';
}
else
{
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
}
}
else
this.velocity = _Movetype_ClipVelocity(this.velocity, trace_plane_normal, 1.0);
if (trace_plane_normal.z > 0.7)
{
- this.flags |= FL_ONGROUND;
+ SET_ONGROUND(this);
this.move_groundentity = trace_ent;
if (trace_ent.solid == SOLID_BSP)
this.move_suspendedinair = true;
}
else
{
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
}
}
break;
// DP revision 8918 (WHY...)
- if (this.flags & FL_ONGROUND)
+ if (IS_ONGROUND(this))
break;
}
- //if (GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE && this.move_didgravity > 0 && !(this.flags & FL_ONGROUND))
+ //if (GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE && this.move_didgravity > 0 && !IS_ONGROUND(this))
// this.velocity_z -= 0.5 * dt * (this.gravity ? this.gravity : 1) * PHYS_GRAVITY(this);
_Movetype_CheckWaterTransition(this);
_Movetype_CheckVelocity(this);
// do a regular slide move unless it looks like you ran into a step
- bool oldonground = (this.flags & FL_ONGROUND);
+ bool oldonground = IS_ONGROUND(this);
vector start_origin = this.origin;
vector start_velocity = this.velocity;
// if the move did not hit the ground at any point, we're not on ground
if (!(clip & 1))
- this.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(this);
_Movetype_CheckVelocity(this);
_Movetype_LinkEdict(this, true);
_Movetype_WallFriction(this, stepnormal);
}
// don't do the down move if stepdown is disabled, moving upward, not in water, or the move started offground or ended onground
- else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) || !oldonground || (this.flags & FL_ONGROUND))
+ else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) || !oldonground || IS_ONGROUND(this))
{
return;
}
if(this.gravity)
{
Movetype_Physics_MatchServer(this, false);
- if(this.flags & FL_ONGROUND)
+ if(IS_ONGROUND(this))
{ // For some reason avelocity gets set to '0 0 0' here ...
this.oldorigin = this.origin;
this.gravity = 0;
{
Movetype_Physics_MatchServer(this, false);
- if(this.flags & FL_ONGROUND)
+ if(IS_ONGROUND(this))
this.gravity = 0;
}
void SUB_Friction (entity this)
{
this.SUB_NEXTTHINK = time;
- if(this.SUB_FLAGS & FL_ONGROUND)
+ if(IS_ONGROUND(this))
this.SUB_VELOCITY = this.SUB_VELOCITY * (1 - frametime * this.friction);
}
#define SUB_THINK(e, f) setthink(e, f)
#define SUB_THUNK(e) getthink(e)
#define SUB_LTIME ltime
-#define SUB_FLAGS flags
void SUB_SetFade (entity ent, float when, float fading_time);
setorigin(player, to);
player.angles = to_angles;
player.velocity = to_velocity;
- player.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(player);
player.iflags |= IFLAG_TELEPORTED | IFLAG_V_ANGLE | IFLAG_ANGLES;
player.csqcmodel_teleported = 1;
player.v_angle = to_angles;
player.vehicle_reload1 = vehic.vehicle_reload1;
player.vehicle_reload2 = vehic.vehicle_reload2;
player.vehicle_energy = vehic.vehicle_energy;
- player.flags &= ~FL_ONGROUND;
+ UNSET_ONGROUND(player);
RemoveGrapplingHook(player);
// FIXME needs a better check to know what is safe to teleport and what not
if(toucher.movetype == MOVETYPE_NONE || toucher.movetype == MOVETYPE_FOLLOW || toucher.tag_entity
+#if 0
|| toucher.move_movetype == MOVETYPE_NONE || toucher.move_movetype == MOVETYPE_FOLLOW
+#endif
#ifdef CSQC
|| tag_networkentity
#endif