]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use the ONGROUND macros
authorMario <mario@smbclan.net>
Fri, 25 Dec 2015 03:37:51 +0000 (13:37 +1000)
committerMario <mario@smbclan.net>
Fri, 25 Dec 2015 03:37:51 +0000 (13:37 +1000)
26 files changed:
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/effects/qc/casings.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/midair/midair.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/physics/movelib.qc
qcsrc/common/physics/movelib.qh
qcsrc/common/physics/movetypes/movetypes.qh
qcsrc/common/physics/player.qh
qcsrc/common/triggers/teleporters.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_player.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/weapons/csqcprojectile.qc

index 91f107486ea3845e897431927e73481bd2052f58..322946740af1c41a56c984146f585cefd9062195 100644 (file)
@@ -649,7 +649,7 @@ void CSQCModel_Hook_PreDraw(bool isplayer)
                        bool onground = 0;
                        if(self == csqcplayer)
                        {
-                               if(self.flags & FL_ONGROUND)
+                               if(IS_ONGROUND(self))
                                        onground = 1;
                                self.anim_prev_pmove_flags = self.flags;
                                if(self.flags & FL_DUCKED)
index 5d8a87d28ce5dbde9612e2f664571eb96134fd1f..4d91acb544111289a85b77a77271fbce27dda2b2 100644 (file)
@@ -49,7 +49,7 @@ void Casing_Draw(entity this)
     {
         self.move_angles_x = 0;
         self.move_angles_z = 0;
-        self.flags &= ~FL_ONGROUND;
+        UNSET_ONGROUND(self);
     }
 
     Movetype_Physics_MatchTicrate(self, autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
index 987b50c41702568f02fe5022ef70723ed4af2397..4a8005d6c2ad40e7991a967e29560429e206cdbc 100644 (file)
@@ -127,7 +127,7 @@ void DropOwner()
        DropBall(self, ownr.origin, ownr.velocity);
        makevectors(ownr.v_angle.y * '0 1 0');
        ownr.velocity += ('0 0 0.75' - v_forward) * 1000;
-       ownr.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(ownr);
 }
 
 void GiveBall(entity plyr, entity ball)
@@ -199,7 +199,7 @@ void DropBall(entity ball, vector org, vector vel)
        setattachment(ball, world, "");
        setorigin(ball, org);
        ball.movetype = MOVETYPE_BOUNCE;
-       ball.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(ball);
        ball.scale = ball_scale;
        ball.velocity = vel;
        ball.nb_droptime = time;
@@ -225,7 +225,7 @@ void DropBall(entity ball, vector org, vector vel)
 void InitBall()
 {SELFPARAM();
        if(gameover) return;
-       self.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(self);
        self.movetype = MOVETYPE_BOUNCE;
        if(self.classname == "nexball_basketball")
                self.touch = basketball_touch;
@@ -729,7 +729,7 @@ void W_Nexball_Touch()
                if((ball = other.ballcarried) && !other.frozen && !other.deadflag && (IS_PLAYER(attacker)))
                {
                        other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
-                       other.flags &= ~FL_ONGROUND;
+                       UNSET_ONGROUND(other);
                        if(!attacker.ballcarried)
                        {
                                LogNB("stole", attacker);
index f30d36065fa34925fcb7437c19e9f4f80c1ff290..a2a42ef99abefa48f01b21bb55c08efe492909d1 100644 (file)
@@ -196,7 +196,7 @@ float M_Shambler_Attack(float attack_type, entity targ)
                        float randomness = random(), enemy_len = vlen(self.enemy.origin - self.origin);
 
                        if(time >= self.shambler_lastattack) // shambler doesn't attack much
-                       if(self.flags & FL_ONGROUND)
+                       if(IS_ONGROUND(self))
                        if(randomness <= 0.5 && enemy_len <= autocvar_g_monster_shambler_attack_smash_range)
                        {
                                setanim(self, self.anim_melee2, true, true, false);
index 27e124674d41285b76ccab192dcae915d35c66c3..92abc8cd916255f083802e0511599b400f3a7a2d 100644 (file)
@@ -382,7 +382,7 @@ float Monster_Attack_Leap_Check(vector vel)
 {SELFPARAM();
        if(self.state && (self.flags & FL_MONSTER))
                return false; // already attacking
-       if(!(self.flags & FL_ONGROUND))
+       if(!(IS_ONGROUND(self)))
                return false; // not on the ground
        if(self.health <= 0)
                return false; // called when dead?
@@ -417,7 +417,7 @@ bool Monster_Attack_Leap(vector anm, void() touchfunc, vector vel, float animtim
        self.touch = touchfunc;
        self.origin_z += 1;
        self.velocity = vel;
-       self.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(self);
 
        return true;
 }
@@ -833,7 +833,7 @@ void Monster_Move(float runspeed, float walkspeed, float stpspeed)
                self.last_enemycheck = time + 1; // check for enemies every second
        }
 
-       if(self.state == MONSTER_ATTACK_RANGED && (self.flags & FL_ONGROUND))
+       if(self.state == MONSTER_ATTACK_RANGED && (IS_ONGROUND(self)))
        {
                self.state = 0;
                self.touch = Monster_Touch;
@@ -861,7 +861,7 @@ void Monster_Move(float runspeed, float walkspeed, float stpspeed)
        if(vlen(self.origin - self.moveto) > 100)
        {
                float do_run = (self.enemy || self.monster_moveto);
-               if((self.flags & FL_ONGROUND) || ((self.flags & FL_FLY) || (self.flags & FL_SWIM)))
+               if((IS_ONGROUND(self)) || ((self.flags & FL_FLY) || (self.flags & FL_SWIM)))
                        Monster_CalculateVelocity(self, self.moveto, self.origin, true, ((do_run) ? runspeed : walkspeed));
 
                if(time > self.pain_finished) // TODO: use anim_finished instead!
@@ -1203,7 +1203,7 @@ void Monster_Anim()
        if(self.crouch)
                animbits |= ANIMSTATE_DUCK; // not that monsters can crouch currently...
        animdecide_setstate(self, animbits, false);
-       animdecide_setimplicitstate(self, (self.flags & FL_ONGROUND));
+       animdecide_setimplicitstate(self, (IS_ONGROUND(self)));
 
        /* // weapon entities for monsters?
        if (self.weaponentity)
index aaae006f52698fd1914a02a21ace52b4f6f29865..7850166a1bc6874649a06a2116fb28d32a9eccf3 100644 (file)
@@ -19,7 +19,7 @@ MUTATOR_HOOKFUNCTION(midair, PlayerDamage_Calculate)
 MUTATOR_HOOKFUNCTION(midair, PlayerPowerups)
 {SELFPARAM();
        if(time >= game_starttime)
-       if(self.flags & FL_ONGROUND)
+       if(IS_ONGROUND(self))
        {
                self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
                self.midair_shieldtime = max(self.midair_shieldtime, time + autocvar_g_midair_shieldtime);
index 90c6c65611d005ffd01c4d90c78cf2bc74dd07dc..4b65abc55675319c966d3df4419be11b0f6867a7 100644 (file)
@@ -743,7 +743,7 @@ void nade_damage(entity inflictor, entity attacker, float damage, int deathtype,
        self.velocity += force;
        UpdateCSQCProjectile(self);
 
-       if(damage <= 0 || ((self.flags & FL_ONGROUND) && IS_PLAYER(attacker)))
+       if(damage <= 0 || ((IS_ONGROUND(self)) && IS_PLAYER(attacker)))
                return;
 
        if(self.health == self.max_health)
index 38afbe2d9084712371fbb56f46c7e4ef39bdaf87..207b4c636de56fae18d7303bd9719d2d1742ab34 100644 (file)
@@ -74,7 +74,7 @@ void movelib_move(vector force,float max_velocity,float drag,float theMass,float
     else
         acceleration = vlen(force);
 
-    if (self.flags & FL_ONGROUND)
+    if (IS_ONGROUND(self))
     {
         if (breakforce)
         {
@@ -150,7 +150,7 @@ void movelib_update(vector dir,float force)
         acceleration += self.buoyancy * '0 0 1';
     }
     else
-        if(self.flags & FL_ONGROUND)
+        if(IS_ONGROUND(self))
             ffriction = self.ground_friction;
         else
             ffriction = self.air_friction;
index c1fd574ca036ea0c6629d0eb5c07c42535392a6d..26b7033ff37a16ea109e422a020f8dac0377fa84 100644 (file)
@@ -38,7 +38,7 @@ void movelib_move_simple(vector newdir,float velo,float blendrate)
     self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo
 
 #define movelib_move_simple_gravity(newdir,velo,blendrate) \
-    if(self.flags & FL_ONGROUND) movelib_move_simple(newdir,velo,blendrate)
+    if(IS_ONGROUND(self)) movelib_move_simple(newdir,velo,blendrate)
 
 void movelib_brake_simple(float force);
 
index 7578ae2fa446faae30fe97a44e84522c2a58e67d..9342ecb21053320b103340b91bc5cf9407d2f8fa 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef MOVETYPES_H
 #define MOVETYPES_H
 
+#define IS_ONGROUND(s)                      boolean((s).flags & FL_ONGROUND)
+#define SET_ONGROUND(s)                     ((s).flags |= FL_ONGROUND)
+#define UNSET_ONGROUND(s)                   ((s).flags &= ~FL_ONGROUND)
+
 .float move_ltime;
 .void()move_think;
 .float move_nextthink;
index 66824bbcf6c24c3ee52eee80a231d663619dfd74..978649026260460935d38dae8388fb42791c6ed4 100644 (file)
@@ -134,10 +134,6 @@ bool IsFlying(entity a);
 #define SET_JUMP_HELD(s)                    ((s).flags &= ~FL_JUMPRELEASED)
 #define UNSET_JUMP_HELD(s)                  ((s).flags |= FL_JUMPRELEASED)
 
-#define IS_ONGROUND(s)                      boolean((s).flags & FL_ONGROUND)
-#define SET_ONGROUND(s)                     ((s).flags |= FL_ONGROUND)
-#define UNSET_ONGROUND(s)                   ((s).flags &= ~FL_ONGROUND)
-
 #define WAS_ONGROUND(s)                     boolean((s).lastflags & FL_ONGROUND)
 
 #define ITEMS_STAT(s)                       ((s).items)
index 0ddc833103f2050e6abf046fa5b06a002f176e19..e7d3c5fd70edf3b4e3a7efb804ed4b900b1ec302 100644 (file)
@@ -138,7 +138,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                                tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
 
                // player no longer is on ground
-               player.flags &= ~FL_ONGROUND;
+               UNSET_ONGROUND(player);
 
                // reset tracking of oldvelocity for impact damage (sudden velocity changes)
                player.oldvelocity = player.velocity;
index ed79df128c907931c2a47832fd9660c40f686778..1d58686bb038e2a5a010024219ac0379145f2c84 100644 (file)
@@ -31,7 +31,7 @@ vector turret_aim_generic()
                        prep = pre_pos + (self.enemy.velocity * (impact_time + mintime));
 
                        if(self.aim_flags & TFL_AIM_ZPREDICT)
-                       if(!(self.enemy.flags & FL_ONGROUND))
+                       if(!IS_ONGROUND(self.enemy))
                        if(self.enemy.movetype == MOVETYPE_WALK || self.enemy.movetype == MOVETYPE_TOSS || self.enemy.movetype == MOVETYPE_BOUNCE)
                        {
                                float vz;
index 179876c320a0d65f0fff3cd7288af2ace37f58a6..819473fe13456826ae355dea5c02a2af17e51547 100644 (file)
@@ -1076,8 +1076,8 @@ void vehicles_enter(entity pl, entity veh)
        //veh.exteriormodeltoclient = veh.owner;
        //veh.tur_head.exteriormodeltoclient = veh.owner;
 
-       pl.flags &= ~FL_ONGROUND;
-       veh.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(pl);
+       UNSET_ONGROUND(veh);
 
        veh.team = pl.team;
        veh.flags -= FL_NOTARGET;
index be552b372d6b743e193da4cc7f4f9eb0f957bc8e..0e8355f5a2cb3fa37cc076bcf19ab2092118bc23 100644 (file)
@@ -134,12 +134,12 @@ float spiderbot_frame()
 
        movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit);
 
-       if(spider.flags & FL_ONGROUND)
+       if(IS_ONGROUND(spider))
                spider.jump_delay = time; // reset now so movement can begin
 
-       //if(spider.flags & FL_ONGROUND)
+       //if(IS_ONGROUND(spider))
        {
-               if(spider.flags & FL_ONGROUND)
+               if(IS_ONGROUND(spider))
                if(spider.frame == 4 && self.tur_head.wait != 0)
                {
                        sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_LAND, VOL_VEHICLEENGINE, ATTEN_NORM);
@@ -149,7 +149,7 @@ float spiderbot_frame()
                if(!player.BUTTON_JUMP)
                        spider.BUTTON_JUMP = 0;
 
-               if((spider.flags & FL_ONGROUND) && player.BUTTON_JUMP && !spider.BUTTON_JUMP && self.tur_head.wait < time)
+               if((IS_ONGROUND(spider)) && player.BUTTON_JUMP && !spider.BUTTON_JUMP && self.tur_head.wait < time)
                {
                        sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_JUMP, VOL_VEHICLEENGINE, ATTEN_NORM);
                        //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
@@ -171,7 +171,7 @@ float spiderbot_frame()
                        if(movefix_y == 0 && movefix_x == 0)
                                sd = v_forward; // always do forward
 
-                       spider.flags &= ~FL_ONGROUND;
+                       UNSET_ONGROUND(spider);
 
                        spider.velocity = sd * 700 + rt * 600 + v_up * 600;
                        spider.frame = 4;
@@ -180,7 +180,7 @@ float spiderbot_frame()
                {
                        if(vlen(player.movement) == 0)
                        {
-                               if(spider.flags & FL_ONGROUND)
+                               if(IS_ONGROUND(spider))
                                {
                                        if(self.sound_nexttime < time || self.delay != 3)
                                        {
@@ -210,13 +210,13 @@ float spiderbot_frame()
                                        if(player.movement_x > 0)
                                        {
                                                player.movement_x = 1;
-                                               if(spider.flags & FL_ONGROUND)
+                                               if(IS_ONGROUND(spider))
                                                        spider.frame = 0;
                                        }
                                        else if(player.movement_x < 0)
                                        {
                                                player.movement_x = -1;
-                                               if(spider.flags & FL_ONGROUND)
+                                               if(IS_ONGROUND(spider))
                                                        spider.frame = 1;
                                        }
                                        player.movement_y = 0;
@@ -226,7 +226,7 @@ float spiderbot_frame()
                                        float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
                                        if(spider.velocity_z <= 20) // not while jumping
                                                spider.velocity_z -= g * sys_frametime * autocvar_sv_gravity;
-                                       if(spider.flags & FL_ONGROUND)
+                                       if(IS_ONGROUND(spider))
                                        if(self.sound_nexttime < time || self.delay != 1)
                                        {
                                                self.delay = 1;
@@ -240,13 +240,13 @@ float spiderbot_frame()
                                        if(player.movement_y < 0)
                                        {
                                                player.movement_y = -1;
-                                               if(spider.flags & FL_ONGROUND)
+                                               if(IS_ONGROUND(spider))
                                                        spider.frame = 2;
                                        }
                                        else if(player.movement_y > 0)
                                        {
                                                player.movement_y = 1;
-                                               if(spider.flags & FL_ONGROUND)
+                                               if(IS_ONGROUND(spider))
                                                        spider.frame = 3;
                                        }
 
@@ -256,7 +256,7 @@ float spiderbot_frame()
                                        float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
                                        if(spider.velocity_z <= 20) // not while jumping
                                                spider.velocity_z -= g * sys_frametime * autocvar_sv_gravity;
-                                       if(spider.flags & FL_ONGROUND)
+                                       if(IS_ONGROUND(spider))
                                        if(self.sound_nexttime < time || self.delay != 2)
                                        {
                                                self.delay = 2;
@@ -572,7 +572,7 @@ spawnfunc(vehicle_spiderbot)
                }
                METHOD(Spiderbot, vr_think, void(Spiderbot thisveh))
                {
-                       if(self.flags & FL_ONGROUND)
+                       if(IS_ONGROUND(self))
                                movelib_brake_simple(autocvar_g_vehicle_spiderbot_speed_stop);
                }
                METHOD(Spiderbot, vr_death, void(Spiderbot thisveh))
index 7bceb538388d109b669f3cc0bdc9f8321501593e..e9973037738df639e2d1f7723dd41214117bbcb2 100644 (file)
@@ -173,7 +173,7 @@ void CSQCPlayer_Physics(entity this)
                        //this.move_movetype = MOVETYPE_WALK; // temp
                        this.move_velocity = this.velocity;
                        this.move_avelocity = this.avelocity;
-                       this.move_flags = BITSET(this.move_flags, FL_ONGROUND, boolean(this.flags & FL_ONGROUND));
+                       this.move_flags = BITSET(this.move_flags, FL_ONGROUND, IS_ONGROUND(this));
                        this.move_flags = BITSET(this.move_flags, FL_WATERJUMP, boolean(this.flags & FL_WATERJUMP));
                        this.move_waterlevel = this.waterlevel;
                        this.move_watertype = this.watertype;
@@ -183,7 +183,7 @@ void CSQCPlayer_Physics(entity this)
                this.pmove_flags =
                                ((this.flags & FL_DUCKED) ? PMF_DUCKED : 0) |
                                (!(this.flags & FL_JUMPRELEASED) ? PMF_JUMP_HELD : 0) |
-                               ((this.flags & FL_ONGROUND) ? PMF_ONGROUND : 0);
+                               ((IS_ONGROUND(this)) ? PMF_ONGROUND : 0);
        }
 }
 
@@ -282,7 +282,7 @@ void CSQCPlayer_SetCamera()
                                const vector o = e.origin;
                                csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED;
                                CSQCPlayer_PredictTo(e, servercommandframe + 1, false);
-                               CSQCPlayer_SetPredictionError(e.origin - o, e.velocity - v0, pmove_onground - boolean(e.flags & FL_ONGROUND));
+                               CSQCPlayer_SetPredictionError(e.origin - o, e.velocity - v0, pmove_onground - IS_ONGROUND(e));
                                e.origin = o;
                                e.velocity = v0;
 
index 09cfe4f1f932217e4c1fa63e944b7d90790a1073..12efd589676bc7ca1ae5b565705807ce2e5b9fe9 100644 (file)
@@ -295,7 +295,7 @@ void havocbot_bunnyhop(vector dir)
        bunnyhopdistance = vlen(self.origin - gco);
 
        // Run only to visible goals
-       if(self.flags & FL_ONGROUND)
+       if(IS_ONGROUND(self))
        if(self.speed==maxspeed)
        if(checkpvs(self.origin + self.view_ofs, self.goalcurrent))
        {
@@ -371,7 +371,7 @@ void havocbot_bunnyhop(vector dir)
 #if 0
        // Release jump button
        if(!cvar("sv_pogostick"))
-       if((self.flags & FL_ONGROUND) == 0)
+       if((IS_ONGROUND(self)) == 0)
        {
                if(self.velocity.z < 0 || vlen(self.velocity)<maxspeed)
                        self.BUTTON_JUMP = false;
@@ -554,7 +554,7 @@ void havocbot_movetogoal()
 
        // If there is a trigger_hurt right below try to use the jetpack or make a rocketjump
        if(skill>6)
-       if (!(self.flags & FL_ONGROUND))
+       if (!(IS_ONGROUND(self)))
        {
                tracebox(self.origin, self.mins, self.maxs, self.origin + '0 0 -65536', MOVE_NOMONSTERS, self);
                if(tracebox_hits_trigger_hurt(self.origin, self.mins, self.maxs, trace_endpos ))
@@ -767,7 +767,7 @@ void havocbot_movetogoal()
                        self.aistatus &= ~AI_STATUS_DANGER_AHEAD;
 
                        if(trace_fraction == 1 && self.jumppadcount == 0 && !self.goalcurrent.wphardwired )
-                       if((self.flags & FL_ONGROUND) || (self.aistatus & AI_STATUS_RUNNING) || self.BUTTON_JUMP == true)
+                       if((IS_ONGROUND(self)) || (self.aistatus & AI_STATUS_RUNNING) || self.BUTTON_JUMP == true)
                        {
                                // Look downwards
                                traceline(dst_ahead , dst_down, true, world);
@@ -849,7 +849,7 @@ void havocbot_movetogoal()
        if(skill+self.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
                havocbot_bunnyhop(dir);
 
-       if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
+       if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (IS_ONGROUND(self))) self.BUTTON_JUMP=1;
        if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=true;
        if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
 }
index 2db5dba02259cc22d3132898cc983a58651af5f0..f49800ff9063f9aa530f321081d5b30b7c8076d3 100644 (file)
@@ -177,7 +177,7 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
                        continue;
 
                // not falling
-               if((it.flags & FL_ONGROUND) == 0)
+               if((IS_ONGROUND(it)) == 0)
                {
                        traceline(it.origin, it.origin + '0 0 -1500', true, world);
                        t = pointcontents(trace_endpos + '0 0 1');
index a1bfb05c0acd1802ea9e14a941dca20feaa389bc..43755799871e3ac5313fa3848160968252355bc0 100644 (file)
@@ -551,7 +551,7 @@ void navigation_markroutes(entity fixed_source_waypoint)
                // try a short range search for the nearest waypoints, and expand the search repeatedly if none are found
                // as this search is expensive we will use lower values if the bot is on the air
                float i, increment, maxdistance;
-               if(self.flags & FL_ONGROUND)
+               if(IS_ONGROUND(self))
                {
                        increment = 750;
                        maxdistance = 50000;
index ba1f7c88db8667cb3e5baebd68c05503ce82317f..d159cba5839c73b5fbdee6888a01a40114d91a87 100644 (file)
@@ -818,7 +818,7 @@ void botframe_showwaypointlinks()
        while (player)
        {
                if (!player.isbot)
-               if (player.flags & FL_ONGROUND || player.waterlevel > WATERLEVEL_NONE)
+               if (IS_ONGROUND(player) || player.waterlevel > WATERLEVEL_NONE)
                {
                        //navigation_testtracewalk = true;
                        head = navigation_findnearestwaypoint(player, false);
index 2a8e5d57135532cdda13eccecfa1606b2c522d3c..cb1387a9c2ef5e15917f6703bfe96989eeeda497 100644 (file)
@@ -880,7 +880,7 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
        draggee.draggravity = draggee.gravity;
        draggee.movetype = MOVETYPE_WALK;
        draggee.gravity = 0.00001;
-       draggee.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(draggee);
        draggee.draggedby = dragger;
 
        dragger.dragentity = draggee;
@@ -924,7 +924,7 @@ void Drag_Finish(entity dragger)
        if((draggee.flags & FL_ITEM) && (vlen(draggee.velocity) < 32))
        {
                draggee.velocity = '0 0 0';
-               draggee.flags |= FL_ONGROUND; // floating items are FUN
+               SET_ONGROUND(draggee); // floating items are FUN
        }
 }
 
@@ -985,7 +985,7 @@ void Drag_Update(entity dragger)
        entity draggee;
 
        draggee = dragger.dragentity;
-       draggee.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(draggee);
 
        curorigin = gettaginfo(draggee, 0);
        curorigin = curorigin + v_forward * dragger.draglocalvector.x + v_right * dragger.draglocalvector.y + v_up * dragger.draglocalvector.z;
index 403c28f3f41c87c6cc9537c24ad482313a603dc4..e194b026f9dd1b802e115a6b67f389c9d1c97798 100644 (file)
@@ -154,7 +154,7 @@ void player_anim ()
        if(self.crouch)
                animbits |= ANIMSTATE_DUCK;
        animdecide_setstate(self, animbits, false);
-       animdecide_setimplicitstate(self, (self.flags & FL_ONGROUND));
+       animdecide_setimplicitstate(self, (IS_ONGROUND(self)));
 }
 
 void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@ -588,7 +588,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                self.solid = SOLID_CORPSE;
                self.ballistics_density = autocvar_g_ballistics_density_corpse;
                // don't stick to the floor
-               self.flags &= ~FL_ONGROUND;
+               UNSET_ONGROUND(self);
                // dying animation
                self.deadflag = DEAD_DYING;
 
index f792874a8218fae1e0b8c38c53ff149a8486e719..a1c4d60e0ab4c1de9dfc4301572c12aa5eb00026 100644 (file)
@@ -855,7 +855,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        self.velocity = self.velocity + farce;
                        self.move_velocity = self.velocity;
                }
-               self.flags &= ~FL_ONGROUND;
+               UNSET_ONGROUND(self);
                self.move_flags &= ~FL_ONGROUND;
                UpdateCSQCProjectile(self);
        }
index 5515c57aa7069ba6365e68a83d353ab6c1f3c180..54cca3e95da7810c57b3a4990ba67db3d15160dd 100644 (file)
@@ -243,7 +243,7 @@ void GrapplingHookThink()
                                                if((frozen_pulling && self.aiment.frozen) || !frozen_pulling)
                                                {
                                                        self.aiment.velocity = self.aiment.velocity - dv * 0.5;
-                                                       self.aiment.flags &= ~FL_ONGROUND;
+                                                       UNSET_ONGROUND(self.aiment);
                                                        if(self.aiment.flags & FL_PROJECTILE)
                                                                UpdateCSQCProjectile(self.aiment);
                                                }
@@ -255,7 +255,7 @@ void GrapplingHookThink()
                                        }
                                }
 
-                               pull_entity.flags &= ~FL_ONGROUND;
+                               UNSET_ONGROUND(pull_entity);
                        }
 
                        if(!frozen_pulling && !(self.aiment.flags & FL_PROJECTILE))
@@ -280,7 +280,7 @@ void GrapplingHookThink()
                        self.realowner.velocity = dir*spd;
                        self.realowner.movetype = MOVETYPE_FLY;
 
-                       self.realowner.flags &= ~FL_ONGROUND;
+                       UNSET_ONGROUND(self.realowner);
                }
        }
 
index c6900aa956dcc430aab17407d5c932ed3375df2b..9bd602426614ee8107ddf49517e4afc68fa4336d 100644 (file)
@@ -964,7 +964,7 @@ void adaptor_think2use()
 
 void adaptor_think2use_hittype_splash() // for timed projectile detonation
 {SELFPARAM();
-       if(!(self.flags & FL_ONGROUND)) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+       if(!(IS_ONGROUND(self))) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
                self.projectiledeathtype |= HITTYPE_SPLASH;
        adaptor_think2use();
 }
index 1b7bd82319de162f4129b0dd4f866d574136685b..7f3d97b943ee9242838778200d42ec9f1e8df500 100644 (file)
@@ -19,7 +19,7 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
        if(self.csqcprojectile_clientanimate)
                sf |= 0x80; // client animated, not interpolated
 
-       if(self.flags & FL_ONGROUND)
+       if(IS_ONGROUND(self))
                sf |= 0x40;
 
        ft = fr = 0;
@@ -71,7 +71,7 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
 void CSQCProjectile_Check(entity e)
 {
        if(e.csqcprojectile_clientanimate)
-       if(e.flags & FL_ONGROUND)
+       if(IS_ONGROUND(e))
        if(e.origin != e.csqcprojectile_oldorigin)
                UpdateCSQCProjectile(e);
        e.csqcprojectile_oldorigin = e.origin;