]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use IS_DEAD everywhere
authorMario <mario@smbclan.net>
Thu, 31 Dec 2015 19:59:05 +0000 (05:59 +1000)
committerMario <mario@smbclan.net>
Thu, 31 Dec 2015 19:59:05 +0000 (05:59 +1000)
67 files changed:
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/campcheck/campcheck.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/nix/nix.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc
qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc
qcsrc/common/mutators/mutator/vampire/vampire.qc
qcsrc/common/t_items.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/magicear.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/fusionreactor.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/race.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/weaponsystem.qc

index d5324ca6fa04aadc08d4b51d18c3b3ae7dae4e97..d895d75c6857bb853ac37a99597d0254edf41ca2 100644 (file)
                                case VOICETYPE_TAUNT:
                                {
                                        if (voicetype == VOICETYPE_AUTOTAUNT) if (!sv_autotaunt) { break; }else {}
-                                       else if (IS_PLAYER(this) && this.deadflag == DEAD_NO) animdecide_setaction(this, ANIMACTION_TAUNT,
+                                       else if (IS_PLAYER(this) && !IS_DEAD(this)) animdecide_setaction(this, ANIMACTION_TAUNT,
                                                        true);
                                        if (!sv_taunt) break;
                                        if (autocvar_sv_gentle) break;
index 4a8005d6c2ad40e7991a967e29560429e206cdbc..d8be44d0dc2a260b2b7ae53dee7e3c41ba5100b2 100644 (file)
@@ -950,7 +950,7 @@ MUTATOR_HOOKFUNCTION(nb, PlayerPreThink)
                                crosshair_trace(self);
                                if( trace_ent &&
                                        IS_CLIENT(trace_ent) &&
-                                       trace_ent.deadflag == DEAD_NO &&
+                                       !IS_DEAD(trace_ent) &&
                                        trace_ent.team == self.team &&
                                        vlen(trace_ent.origin - self.origin) <= autocvar_g_nexball_safepass_maxdist )
                                {
index c0f2eac21d16fd5017fc9f94d8b6162202fb2a60..d75003346d688cf0f58ea8428382a763ed014ac5 100644 (file)
@@ -572,7 +572,7 @@ void ons_ControlPoint_Icon_Think()
                int _friendly_count = 0;
                float _dist;
 
-               FOREACH_CLIENT(IS_PLAYER(it) && it.deadflag == DEAD_NO, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
                        _dist = vlen(it.origin - self.origin);
                        if(_dist < autocvar_g_onslaught_cp_proxydecap_distance)
                        {
@@ -800,7 +800,7 @@ void ons_ControlPoint_Touch()
 
        if(!IS_PLAYER(toucher)) { return; }
        if(toucher.frozen) { return; }
-       if(toucher.deadflag != DEAD_NO) { return; }
+       if(IS_DEAD(toucher)) { return; }
 
        if ( SAME_TEAM(self,toucher) )
        if ( self.iscaptured )
@@ -1554,7 +1554,7 @@ bool havocbot_goalrating_ons_generator_attack(float ratingscale)
 
 void havocbot_role_ons_offense()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                self.havocbot_attack_time = 0;
                havocbot_ons_reset_role(self);
@@ -1599,7 +1599,7 @@ void havocbot_role_ons_defense()
 
 void havocbot_ons_reset_role(entity bot)
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        bot.havocbot_ons_target = world;
@@ -2111,7 +2111,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerUseKey)
 {SELFPARAM();
        if(MUTATOR_RETURNVALUE || gameover) { return false; }
 
-       if((time > self.teleport_antispam) && (self.deadflag == DEAD_NO) && !self.vehicle)
+       if((time > self.teleport_antispam) && (!IS_DEAD(self)) && !self.vehicle)
        {
                entity source_point = ons_Nearest_ControlPoint(self.origin, autocvar_g_onslaught_teleport_radius);
                if ( source_point )
index ac5dd514cf442df613ba46e98397e0c5fbba74bf..14d30cd27e67d3b27c923f249ece2db92b27e7e4 100644 (file)
@@ -182,7 +182,7 @@ void M_Mage_Attack_Spike_Think()
        );
 
        if (self.enemy != world)
-               if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
+               if (self.enemy.takedamage != DAMAGE_AIM || IS_DEAD(self.enemy))
                        self.enemy = world;
 
        if (self.enemy != world)
index 8dff94a6ada6cb0171faab9be8e23181f359c5b4..0ec5f78ff462b7d375b530676abdfa4b93c82bbf 100644 (file)
@@ -137,7 +137,7 @@ void M_Spider_Attack_Web_Explode()
                Send_Effect(EFFECT_ELECTRO_IMPACT, self.origin, '0 0 0', 1);
                RadiusDamage(self, self.realowner, 0, 0, 25, world, world, 25, self.projectiledeathtype, world);
 
-               for(e = findradius(self.origin, 25); e; e = e.chain) if(e != self) if(e.takedamage && e.deadflag == DEAD_NO) if(e.health > 0) if(e.monsterid != MON_SPIDER.monsterid)
+               for(e = findradius(self.origin, 25); e; e = e.chain) if(e != self) if(e.takedamage && !IS_DEAD(e)) if(e.health > 0) if(e.monsterid != MON_SPIDER.monsterid)
                        e.spider_slowness = time + (autocvar_g_monster_spider_attack_web_damagetime);
 
                remove(self);
index 9a934ba748c0f471a54f8cab279903126687f499..684d1615f3966a4e9adf6e90d1c94f01ae739b9e 100644 (file)
@@ -91,7 +91,7 @@ bool Monster_ValidTarget(entity mon, entity player)
        || (player.takedamage == DAMAGE_NO)
        || (player.items & IT_INVISIBILITY)
        || (IS_SPEC(player) || IS_OBSERVER(player)) // don't attack spectators
-       || (!IS_VEHICLE(player) && (player.deadflag != DEAD_NO || mon.deadflag != DEAD_NO || player.health <= 0 || mon.health <= 0))
+       || (!IS_VEHICLE(player) && (IS_DEAD(player) || IS_DEAD(mon) || player.health <= 0 || mon.health <= 0))
        || (mon.monster_follow == player || player.monster_follow == mon)
        || (!IS_VEHICLE(player) && (player.flags & FL_NOTARGET))
        || (!autocvar_g_monsters_typefrag && player.BUTTON_CHAT)
@@ -564,7 +564,7 @@ vector Monster_Move_Target(entity targ)
                WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self);
 
                if((self.enemy == world)
-                       || (self.enemy.deadflag != DEAD_NO || self.enemy.health < 1)
+                       || (IS_DEAD(self.enemy) || self.enemy.health < 1)
                        || (self.enemy.frozen)
                        || (self.enemy.flags & FL_NOTARGET)
                        || (self.enemy.alpha < 0.5 && self.enemy.alpha != 0)
index ca3716669087de024f22082ceb68e6a382e55448..54e8237ecde7e5022c87f22c7c8401cec6f5afc1 100644 (file)
@@ -6,7 +6,7 @@ REGISTER_MUTATOR(bloodloss, cvar("g_bloodloss"));
 MUTATOR_HOOKFUNCTION(bloodloss, PlayerPreThink)
 {SELFPARAM();
        if(IS_PLAYER(self))
-       if(self.health <= autocvar_g_bloodloss && self.deadflag == DEAD_NO)
+       if(self.health <= autocvar_g_bloodloss && !IS_DEAD(self))
        {
                self.BUTTON_CROUCH = true;
 
index 2c6bcfb41cd169fb07bbcdaa46aaa018e5e22c78..e16dc8f933c4703f5eab8b3557b13fc8146de0f6 100644 (file)
@@ -334,7 +334,7 @@ void buff_Think()
        }
 
        if(!self.buff_active && !self.buff_activetime)
-       if(!self.owner || self.owner.frozen || self.owner.deadflag != DEAD_NO || !self.owner.iscreature || !(self.owner.buffs & self.buffs))
+       if(!self.owner || self.owner.frozen || IS_DEAD(self.owner) || !self.owner.iscreature || !(self.owner.buffs & self.buffs))
        {
                buff_SetCooldown(autocvar_g_buffs_cooldown_respawn + frametime);
                self.owner = world;
@@ -586,7 +586,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate)
        if(!frag_target.vehicle)
        if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
        if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
-       if(frag_target.deadflag == DEAD_NO)
+       if(!IS_DEAD(frag_target))
        if(IS_PLAYER(frag_target) || IS_MONSTER(frag_target))
        if(frag_attacker != frag_target)
        if(!frag_target.frozen)
@@ -698,7 +698,7 @@ MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon)
                float best_distance = autocvar_g_buffs_swapper_range;
                entity closest = world;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(it.deadflag == DEAD_NO && !it.frozen && !it.vehicle)
+                       if(!IS_DEAD(it) && !it.frozen && !it.vehicle)
                        if(DIFF_TEAM(it, self))
                        if(vlen(self.origin - it.origin) <= best_distance)
                        {
@@ -830,7 +830,7 @@ MUTATOR_HOOKFUNCTION(buffs, WeaponSpeedFactor)
 
 MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
 {SELFPARAM();
-       if(gameover || self.deadflag != DEAD_NO) { return false; }
+       if(gameover || IS_DEAD(self)) { return false; }
 
        if(time < self.buff_disability_time)
        if(time >= self.buff_disability_effect_time)
index 0ba0bb64e1f93f98831c38f54b940e9c9766f6cb..0c4a88d61416c2177fefe5a8b3fa9ff9cc54e9dc 100644 (file)
@@ -35,7 +35,7 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink)
        if(time >= game_starttime)
        if(IS_PLAYER(self))
        if(IS_REAL_CLIENT(self)) // bots may camp, but that's no reason to constantly kill them
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        if(!self.frozen)
        if(!self.BUTTON_CHAT)
        if(autocvar_g_campcheck_interval)
index cfac98232ad37047ad4676309d801c142835b53b..3fd4d6ce5c7358befb40498e1c6f43b62703b2a2 100644 (file)
@@ -403,7 +403,7 @@ void nade_ice_think()
        for(e = findradius(self.origin, autocvar_g_nades_nade_radius); e; e = e.chain)
        if(e != self)
        if(!autocvar_g_nades_ice_teamcheck || (DIFF_TEAM(e, self.realowner) || e == self.realowner))
-       if(e.takedamage && e.deadflag == DEAD_NO)
+       if(e.takedamage && !IS_DEAD(e))
        if(e.health > 0)
        if(!e.revival_time || ((time - e.revival_time) >= 1.5))
        if(!e.frozen)
@@ -509,7 +509,7 @@ void nade_heal_touch()
        float maxhealth;
        float health_factor;
        if(IS_PLAYER(other) || IS_MONSTER(other))
-       if(other.deadflag == DEAD_NO)
+       if(!IS_DEAD(other))
        if(!other.frozen)
        {
                health_factor = autocvar_g_nades_heal_rate*frametime/2;
@@ -850,7 +850,7 @@ void nades_GiveBonus(entity player, float score)
        if (IS_REAL_CLIENT(player))
        if (IS_PLAYER(player) && player.bonus_nades < autocvar_g_nades_bonus_max)
        if (player.frozen == 0)
-       if (player.deadflag == DEAD_NO)
+       if (!IS_DEAD(player))
        {
                if ( player.bonus_nade_score < 1 )
                        player.bonus_nade_score += score/autocvar_g_nades_bonus_score_max;
@@ -965,7 +965,7 @@ float CanThrowNade()
        if(gameover)
                return false;
 
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return false;
 
        if (!autocvar_g_nades)
@@ -1130,7 +1130,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
                vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
                n = 0;
                FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA(
-                       if(it.deadflag == DEAD_NO)
+                       if(!IS_DEAD(it))
                        if(it.frozen == 0)
                        if(SAME_TEAM(it, self))
                        if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, it.absmin, it.absmax))
index c3aadca41962ea849dd822789680b494e02044f2..d265d33185acfd7536e628e80be57903524eda3c 100644 (file)
@@ -54,7 +54,7 @@ REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill"
        MUTATOR_ONREMOVE
        {
                // as the PlayerSpawn hook will no longer run, NIX is turned off by this!
-               FOREACH_CLIENT(IS_PLAYER(it) && it.deadflag == DEAD_NO, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
                        it.ammo_cells = start_ammo_cells;
                        it.ammo_plasma = start_ammo_plasma;
                        it.ammo_shells = start_ammo_shells;
@@ -264,7 +264,7 @@ MUTATOR_HOOKFUNCTION(nix, OnEntityPreSpawn)
 MUTATOR_HOOKFUNCTION(nix, PlayerPreThink)
 {SELFPARAM();
        if(!intermission_running)
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        if(IS_PLAYER(self))
                NIX_GiveCurrentWeapon();
        return 0;
index d50c75bef97cf3dc921927ca4980aa2a6c4fbfe7..758437ef02a9a3a3ce0d1f0f70ecea12bdda68b4 100644 (file)
@@ -102,7 +102,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDamage_Calculate, CBC_ORDER_LAST)
                if(frag_attacker != frag_target)
                if(frag_target.health > 0)
                if(frag_target.frozen == 0)
-               if(frag_target.deadflag == DEAD_NO)
+               if(!IS_DEAD(frag_target))
                {
                        Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE);
                        frag_force = '0 0 0';
@@ -178,7 +178,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
        if(intermission_running || gameover)
                return false;
 
-       if(self.deadflag != DEAD_NO || !IS_PLAYER(self) || self.frozen)
+       if(IS_DEAD(self) || !IS_PLAYER(self) || self.frozen)
                return false;
 
        if(self.ok_lastwep)
index f8a66eaef61d076727c8938287210c2cb90f529b..80bf57a3ee4e18e4919a6452f0c8df199aaff184 100644 (file)
@@ -27,7 +27,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score)
                return 0;
 
        RandomSelection_Init();
-       FOREACH_CLIENT(IS_PLAYER(it) && it != self && SAME_TEAM(it, self) && it.deadflag == DEAD_NO, LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && it != self && SAME_TEAM(it, self) && !IS_DEAD(it), LAMBDA(
                float l = vlen(spawn_spot.origin - it.origin);
                if(l > autocvar_g_spawn_near_teammate_distance)
                        continue;
@@ -63,7 +63,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
                float pc = 0, best_dist = 0, dist = 0;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
                        if((autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health >= 0 && it.health >= autocvar_g_balance_health_regenstable) || autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health == 0)
-                       if(it.deadflag == DEAD_NO)
+                       if(!IS_DEAD(it))
                        if(it.msnt_timer < time)
                        if(SAME_TEAM(self, it))
                        if(time > it.spawnshieldtime) // spawn shielding
index 2b9ca637d1bd81a5f90f903804478214314c61bf..d7ba22216b06fa5e20ffc3b3c522e797d6b4c631 100644 (file)
@@ -28,12 +28,12 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
        if(!gameover)
        if(!self.frozen)
        if(IS_PLAYER(self))
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        if(!IS_INDEPENDENT_PLAYER(self))
                FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA(
                        if(time > it.touchexplode_time)
                        if(!it.frozen)
-                       if(it.deadflag == DEAD_NO)
+                       if(!IS_DEAD(it))
                        if (!IS_INDEPENDENT_PLAYER(it))
                        if(boxesoverlap(self.absmin, self.absmax, it.absmin, it.absmax))
                        {
index 315da7dc6f12a448cdfc3d265b5c07506fdc414f..6a2e1fdb74fead3355e5867d57347e19f090e67a 100644 (file)
@@ -5,7 +5,7 @@ MUTATOR_HOOKFUNCTION(vampire, PlayerDamage_SplitHealthArmor)
 {
        if(time >= frag_target.spawnshieldtime)
        if(frag_target != frag_attacker)
-       if(frag_target.deadflag == DEAD_NO)
+       if(!IS_DEAD(frag_target))
        {
                frag_attacker.health += bound(0, damage_take, frag_target.health);
                frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit);
index 97fc76c09826fecb9d3fc490602facddee058416..945abd531fc2eeeede79634613226758ff0d7da4 100644 (file)
@@ -1421,7 +1421,7 @@ void target_items_use()
 
        if (!IS_PLAYER(activator))
                return;
-       if(activator.deadflag != DEAD_NO)
+       if(IS_DEAD(activator))
                return;
        EXACTTRIGGER_TOUCH;
 
index 5eb47fa36afcd075379a91e4ba408c6abe8044c7..c834a06a29c5ffb205366067c2c130de624957d7 100644 (file)
@@ -10,7 +10,7 @@ void generic_plat_blocked()
                }
 
                // Gib dead/dying stuff
-               if(other.deadflag != DEAD_NO)
+               if(IS_DEAD(other))
                        Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
        }
 #endif
@@ -160,7 +160,7 @@ void plat_crush()
                {   // Shall we bite?
                        Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                        // Gib dead/dying stuff
-                       if(other.deadflag != DEAD_NO)
+                       if(IS_DEAD(other))
                                Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
index 1050f8ebdbcf905bd372968f204ed0c811030732..b4dc20a7d767aacb9c5b5a496c3a4b3d3f0cdc25 100644 (file)
@@ -134,7 +134,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        if(IS_PLAYER(player))
        {
                if(tflags & TELEPORT_FLAG_TDEATH)
-                       if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
+                       if(player.takedamage && !IS_DEAD(player) && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
                                tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
 
                // player no longer is on ground
index 10d422fd6426ea361d3a65d15bf6d5cf59b1add9..c83ea06fa220765223c6fc12437ac26f61bfebc2 100644 (file)
@@ -223,7 +223,7 @@ void trigger_push_touch()
                        else
                                other.lastteleporttime = time;
 
-                       if (other.deadflag == DEAD_NO)
+                       if (!IS_DEAD(other))
                                animdecide_setaction(other, ANIMACTION_JUMP, true);
                }
                else
index c20514e1a61f8e9cff3b0355c77bee16d10fce4f..f973c7a6fd42139053829d06117dcf229e406eec 100644 (file)
@@ -9,7 +9,7 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay,
 
        magicear_matched = false;
 
-       dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius)));
+       dotrigger = ((IS_PLAYER(source)) && (!IS_DEAD(source)) && ((ear.radius == 0) || (vdist(source.origin - ear.origin, <=, ear.radius))));
        domatch = ((ear.spawnflags & 32) || dotrigger);
 
        if (!domatch)
index a6d9418b3b84e8c05e58b9cc9a0cb56639f81609..f7e69495228b97987d3dbd636c93015c1ca2e4b8 100644 (file)
@@ -23,7 +23,7 @@ void viewloc_think()
                for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain)
                        if(!e.viewloc)
                                if(IS_PLAYER(e)) // should we support non-player entities with this?
-                               //if(e.deadflag == DEAD_NO) // death view is handled separately, we can't override this just yet
+                               //if(!IS_DEAD(e)) // death view is handled separately, we can't override this just yet
                                {
                                        vector emin = e.absmin;
                                        vector emax = e.absmax;
index fc10451d3970bb25cb04e205c4496c5771a96a08..02655d6b2d0e47c0f4e13063c25b3a6a911861d2 100644 (file)
@@ -735,7 +735,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl
                if(!(validate_flags & TFL_TARGETSELECT_PLAYERS))
                        return -7;
 
-               if (e_target.deadflag != DEAD_NO)
+               if (IS_DEAD(e_target))
                        return -8;
        }
 
@@ -923,7 +923,7 @@ float turret_firecheck()
 
        // Lack of zombies makes shooting dead things unnecessary :P
        if (self.firecheck_flags & TFL_FIRECHECK_DEAD)
-               if (self.enemy.deadflag != DEAD_NO)
+               if (IS_DEAD(self.enemy))
                        return 0;
 
        // Own ammo?
index 889ba79a043563bdc6519718d2f5d86d18e8f6fe..4f3e7cc704869257d18f23886277bb868034a45e 100644 (file)
@@ -22,7 +22,7 @@ bool turret_fusionreactor_firecheck()
     if (self.attack_finished_single[0] > time)
         return false;
 
-    if (self.enemy.deadflag != DEAD_NO)
+    if (IS_DEAD(self.enemy))
         return false;
 
     if (self.enemy == world)
index 5b7f42f45ede3488c9d025dfc268fe706e28a63f..4a559b08ee7f87e28aa23b2dfd1b54f611b190ed 100644 (file)
@@ -66,7 +66,7 @@ void turret_hellion_missile_think()
         turret_projectile_explode();
 
     // Enemy dead? just keep on the current heading then.
-    if ((self.enemy == world) || (self.enemy.deadflag != DEAD_NO))
+    if ((self.enemy == world) || (IS_DEAD(self.enemy)))
     {
 
         // Make sure we dont return to tracking a respawned player
index b24623097876c1bdd6f7b6befb20cf4b8f6c2310..58c22a79b524b8cb3ef641e2bbc5fe00c7b05c4e 100644 (file)
@@ -74,7 +74,7 @@ void turret_hk_missile_think()
     //if (self.cnt < time)
     // turret_hk_missile_explode();
 
-    if (self.enemy.deadflag != DEAD_NO)
+    if (IS_DEAD(self.enemy))
         self.enemy = world;
 
     // Pick the closest valid target.
@@ -276,7 +276,7 @@ bool hk_is_valid_target(entity e_target)
         if (self.owner.target_select_playerbias < 0)
             return 0;
 
-        if (e_target.deadflag != DEAD_NO)
+        if (IS_DEAD(e_target))
             return 0;
     }
 
index 087ade8d47b2c1e7e23ac18b1e647433eab2a4b9..8c1134eaf0baeb1e7f0fdfbebfaa0cf6212355f8 100644 (file)
@@ -65,7 +65,7 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity
 
 void beam_think()
 {SELFPARAM();
-    if ((time > self.cnt) || (self.owner.deadflag != DEAD_NO))
+    if ((time > self.cnt) || (IS_DEAD(self.owner)))
     {
         self.owner.attack_finished_single[0] = time + self.owner.shot_refire;
         self.owner.fireflag = 2;
index c541f9131c88a91ff106be6a59d16b45bd024f75..caec872785062322089a7507151534cf616ae891 100644 (file)
@@ -157,7 +157,7 @@ void walker_rocket_think()
     m_speed = vlen(self.velocity);
 
     // Enemy dead? just keep on the current heading then.
-    if (self.enemy == world || self.enemy.deadflag != DEAD_NO)
+    if (self.enemy == world || IS_DEAD(self.enemy))
         self.enemy = world;
 
     if (self.enemy)
index cd9efff072f078108f12c356e550f6559fb169d2..c72c60807c2cdd3cccf9625f67c79216f3d92f1f 100644 (file)
@@ -107,7 +107,7 @@ vector targetdrone_getnewspot()
 
 void vehicles_locktarget(float incr, float decr, float _lock_time)
 {SELFPARAM();
-       if(self.lock_target && self.lock_target.deadflag != DEAD_NO)
+       if(self.lock_target && IS_DEAD(self.lock_target))
        {
                self.lock_target        = world;
                self.lock_strength  = 0;
@@ -131,7 +131,7 @@ void vehicles_locktarget(float incr, float decr, float _lock_time)
                if(SAME_TEAM(trace_ent, self))
                        trace_ent = world;
 
-               if(trace_ent.deadflag != DEAD_NO)
+               if(IS_DEAD(trace_ent))
                        trace_ent = world;
 
                if(!(IS_VEHICLE(trace_ent) || IS_TURRET(trace_ent)))
@@ -550,7 +550,7 @@ void vehicles_setreturn(entity veh)
        ret.team                = veh.team;
        ret.think          = vehicles_showwp;
 
-       if(veh.deadflag != DEAD_NO)
+       if(IS_DEAD(veh))
        {
                ret.cnt          = time + veh.respawntime;
                ret.nextthink   = min(time + veh.respawntime, time + veh.respawntime - 5);
@@ -576,7 +576,7 @@ void vehicle_use()
        else
                self.active = ACTIVE_ACTIVE;
 
-       if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO && !gameover)
+       if(self.active == ACTIVE_ACTIVE && !IS_DEAD(self) && !gameover)
        {
                LOG_TRACE("Respawning vehicle: ", self.netname, "\n");
                if(self.effects & EF_NODRAW)
@@ -886,7 +886,7 @@ void vehicles_exit(bool eject)
        }
        _vehicle.flags |= FL_NOTARGET;
 
-       if(_vehicle.deadflag == DEAD_NO)
+       if(!IS_DEAD(_vehicle))
                _vehicle.avelocity = '0 0 0';
 
        _vehicle.tur_head.nodrawtoclient = world;
@@ -956,7 +956,7 @@ bool vehicle_impulse(entity this, int imp)
 {
        entity v = this.vehicle;
        if (!v) return false;
-       if (v.deadflag != DEAD_NO) return false;
+       if (IS_DEAD(v)) return false;
        bool(int) f = v.vehicles_impulse;
        if (f && f(imp)) return true;
        switch (imp)
@@ -980,7 +980,7 @@ void vehicles_enter(entity pl, entity veh)
        || (veh.phase >= time)
        || (pl.vehicle_enter_delay >= time)
        || (pl.frozen)
-       || (pl.deadflag != DEAD_NO)
+       || (IS_DEAD(pl))
        || (pl.vehicle)
        ) { return; }
 
index 26e64d0d2691578a777b6790214c69445eb75d66..ad236e07e3a34c15a97d94fb37d44c0d86332d91 100644 (file)
@@ -359,7 +359,7 @@ bool vehicles_valid_pilot()
                return false;
 
        if((!IS_PLAYER(other))
-       || (other.deadflag != DEAD_NO)
+       || (IS_DEAD(other))
        || (other.vehicle)
        || (DIFF_TEAM(other, self))
        ) { return false; }
@@ -426,7 +426,7 @@ float bumblebee_pilot_frame()
        vehic = self.vehicle;
        setself(vehic);
 
-       if(vehic.deadflag != DEAD_NO)
+       if(IS_DEAD(vehic))
        {
                setself(pilot);
                pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = 0;
@@ -562,7 +562,7 @@ float bumblebee_pilot_frame()
                        }
                        else
                        {
-                               if(trace_ent.deadflag == DEAD_NO)
+                               if(!IS_DEAD(trace_ent))
                                        if((teamplay && trace_ent.team == pilot.team) || !teamplay)
                                        {
 
@@ -659,7 +659,7 @@ void bumblebee_exit(float eject)
 
        self.touch = vehicles_touch;
 
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        {
                self.think = bumblebee_land;
                self.nextthink  = time;
index da89dc0aa94fb75cb95dc4d9fe7472320b65e17b..5da6cae37a19bec43e2e39ee0c7b267e34de2fb7 100644 (file)
@@ -182,7 +182,7 @@ float racer_frame()
        if(pointcontents(racer.origin) != CONTENT_WATER)
                racer.air_finished = time + autocvar_g_vehicle_racer_water_time;
 
-       if(racer.deadflag != DEAD_NO)
+       if(IS_DEAD(racer))
        {
                setself(player);
                player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
index 678f9af0b6b69457ef18a17af60002f5cc1936bf..a4cf0dde2e958e0885b3d2326ee8fe59af030ea0 100644 (file)
@@ -109,7 +109,7 @@ void racer_rocket_tracker()
 
     self.nextthink  = time;
 
-    if (self.owner.deadflag != DEAD_NO || self.cnt < time)
+    if (IS_DEAD(self.owner) || self.cnt < time)
     {
         self.use();
         return;
@@ -161,7 +161,7 @@ void racer_rocket_groundhugger()
 
     self.nextthink  = time;
 
-    if(self.owner.deadflag != DEAD_NO || self.cnt < time)
+    if(IS_DEAD(self.owner) || self.cnt < time)
     {
         self.use();
         return;
index 7ebac8152adeed819a6d57eb3ad3e290ccf21605..f212b4ce45c6578bd0a9cdbcbfa62768cd14ce8c 100644 (file)
@@ -114,7 +114,7 @@ void raptor_exit(float eject)
        vector spot;
        self.tur_head.exteriormodeltoclient = world;
 
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        {
                self.think        = raptor_land;
                self.nextthink  = time;
@@ -198,7 +198,7 @@ float raptor_frame()
        }
        */
 
-       if(raptor.deadflag != DEAD_NO)
+       if(IS_DEAD(raptor))
        {
                setself(player);
                player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
index 12007fc39ab6cf73491e24842dadfa8caf881289..7a657961d5f8c220d7e3a0b9f3c09031c19f0c1a 100644 (file)
@@ -50,7 +50,7 @@ void spiderbot_rocket_unguided()
 
     UpdateCSQCProjectile(self);
 
-    if (self.owner.deadflag != DEAD_NO || self.cnt < time || vlen(self.pos1 - self.origin) < 16)
+    if (IS_DEAD(self.owner) || self.cnt < time || vlen(self.pos1 - self.origin) < 16)
         self.use();
 }
 
@@ -70,7 +70,7 @@ void spiderbot_rocket_guided()
 
     UpdateCSQCProjectile(self);
 
-    if (self.owner.deadflag != DEAD_NO || self.cnt < time)
+    if (IS_DEAD(self.owner) || self.cnt < time)
         self.use();
 }
 
index 959e0939d3b010806028f6c9b71dcaba5e6db497..f34006b670a65530bba663ab330ccf64600ec95f 100644 (file)
@@ -241,7 +241,7 @@ void W_Arc_Beam_Think()
                ||
                (self.owner.(thiswep.ammo_field) <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO))
                ||
-               self.owner.deadflag != DEAD_NO
+               IS_DEAD(self.owner)
                ||
                (!self.owner.BUTTON_ATCK && !burst )
                ||
index ba1e9b0fe76f34ed9c71de1c119e1467a40f2478..455567a2f2eedf912c67349827b9632ad7c5be9f 100644 (file)
@@ -278,7 +278,7 @@ float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
 
        while(head)
        {
-               if((head.takedamage != DAMAGE_NO) && (head.deadflag == DEAD_NO))
+               if((head.takedamage != DAMAGE_NO) && (!IS_DEAD(head)))
                {
                        if(SAME_TEAM(head, projectile.realowner))
                                ++hit_friendly;
index 69e925d112e2515c580546aa106da8a4dbcd26c4..d632d7776a87f7886a976f7811fc1b26b54aaaba 100644 (file)
@@ -88,7 +88,7 @@ void W_Devastator_Explode()
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
-                               if(other.deadflag == DEAD_NO)
+                               if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                                Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
@@ -206,7 +206,7 @@ void W_Devastator_DoRemoteExplode(.entity weaponentity)
 
 void W_Devastator_RemoteExplode(.entity weaponentity)
 {SELFPARAM();
-       if(self.realowner.deadflag == DEAD_NO)
+       if(!IS_DEAD(self.realowner))
        if(self.realowner.lastrocket)
        {
                if((self.spawnshieldtime >= 0)
@@ -279,7 +279,7 @@ void W_Devastator_Think()
                if(!self.BUTTON_ATCK2)
                if(WEP_CVAR(devastator, guiderate))
                if(time > self.pushltime)
-               if(self.realowner.deadflag == DEAD_NO)
+               if(!IS_DEAD(self.realowner))
                {
                        f = WEP_CVAR(devastator, guideratedelay);
                        if(f)
index a72ff3927c82a6087d64d2ad9b5d28baa3d8b8dc..fd1f74ecd302458770fa12d68a9d02c4316e544c 100644 (file)
@@ -149,7 +149,7 @@ void W_Electro_Explode()
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
-                               if(other.deadflag == DEAD_NO)
+                               if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                                Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
 
index 17ef5847ae0cc6990fa50298cf14b22321759163..8725688173f5521e0973d5a101872bd8dde81dd5 100644 (file)
@@ -114,7 +114,7 @@ void W_MineLayer_Explode()
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
-                               if(other.deadflag == DEAD_NO)
+                               if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                                Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
@@ -169,7 +169,7 @@ void W_MineLayer_DoRemoteExplode()
 
 void W_MineLayer_RemoteExplode()
 {SELFPARAM();
-       if(self.realowner.deadflag == DEAD_NO)
+       if(!IS_DEAD(self.realowner))
                if((self.spawnshieldtime >= 0)
                        ? (time >= self.spawnshieldtime) // timer
                        : (vlen(NearestPointOnBox(self.realowner, self.origin) - self.origin) > WEP_CVAR(minelayer, remote_radius)) // safety device
@@ -235,7 +235,7 @@ void W_MineLayer_Think()
 
        // a player's mines shall explode if he disconnects or dies
        // TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
-       if(!IS_PLAYER(self.realowner) || self.realowner.deadflag != DEAD_NO || self.realowner.frozen)
+       if(!IS_PLAYER(self.realowner) || IS_DEAD(self.realowner) || self.realowner.frozen)
        {
                other = world;
                self.projectiledeathtype |= HITTYPE_BOUNCE;
@@ -247,7 +247,7 @@ void W_MineLayer_Think()
        head = findradius(self.origin, WEP_CVAR(minelayer, proximityradius));
        while(head)
        {
-               if(IS_PLAYER(head) && head.deadflag == DEAD_NO && !head.frozen)
+               if(IS_PLAYER(head) && !IS_DEAD(head) && !head.frozen)
                if(head != self.realowner && DIFF_TEAM(head, self.realowner)) // don't trigger for team mates
                if(!self.mine_time)
                {
@@ -266,7 +266,7 @@ void W_MineLayer_Think()
 
        // remote detonation
        if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
-       if(self.realowner.deadflag == DEAD_NO)
+       if(!IS_DEAD(self.realowner))
        if(self.minelayer_detonate)
                W_MineLayer_RemoteExplode();
 }
@@ -283,7 +283,7 @@ void W_MineLayer_Touch()
                return;
        }
 
-       if(other && IS_PLAYER(other) && other.deadflag == DEAD_NO)
+       if(other && IS_PLAYER(other) && !IS_DEAD(other))
        {
                // hit a player
                // don't stick
index bac1ef3d587c1ad0aebad257cd0841b5edc09647..a19f38dc0ba1dd8e1041e64cc9896e00be0d00d9 100644 (file)
@@ -69,7 +69,7 @@ void W_Mortar_Grenade_Explode()
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
-                               if(other.deadflag == DEAD_NO)
+                               if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                                Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
@@ -89,7 +89,7 @@ void W_Mortar_Grenade_Explode2()
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
-                               if(other.deadflag == DEAD_NO)
+                               if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                                Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
 
index 59731c95429d3a816f00b43c9912d128d51ee381..580a5bece594e77d7f68e4c950a34652b1ab745d 100644 (file)
@@ -82,7 +82,7 @@ void W_Porto_Fail(float failhard)
 
        self.realowner.porto_current = world;
 
-       if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !(self.realowner.weapons & WEPSET(PORTO)))
+       if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && !IS_DEAD(self.realowner) && !(self.realowner.weapons & WEPSET(PORTO)))
        {
                setsize(self, '-16 -16 0', '16 16 32');
                setorigin(self, self.origin + trace_plane_normal);
index 911ebb07d0efab4d8d72dad92197b315c02d372a..c777562e4d99808e01a93923ba19d515469e4138 100644 (file)
@@ -131,7 +131,7 @@ void W_Seeker_Missile_Think()
        );
 
        if(self.enemy != world)
-               if(self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
+               if(self.enemy.takedamage != DAMAGE_AIM || IS_DEAD(self.enemy))
                        self.enemy = world;
 
        if(self.enemy != world)
@@ -191,7 +191,7 @@ void W_Seeker_Missile_Think()
        }
        ///////////////
 
-       if(self.enemy.deadflag != DEAD_NO)
+       if(IS_DEAD(self.enemy))
        {
                self.enemy = world;
                self.cnt = time + 1 + (random() * 4);
@@ -230,7 +230,7 @@ void W_Seeker_Missile_Animate()
        self.nextthink = time + 0.05;
 
        if(self.enemy != world)
-               if(self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
+               if(self.enemy.takedamage != DAMAGE_AIM || IS_DEAD(self.enemy))
                        self.enemy = world;
 
        if(self.frame == 5)
@@ -421,7 +421,7 @@ void W_Seeker_Vollycontroller_Think() // TODO: Merge this with W_Seeker_Attack
        self.cnt = self.cnt - 1;
 
        Weapon thiswep = WEP_SEEKER;
-       if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.(thiswep.ammo_field) < WEP_CVAR(seeker, missile_ammo)) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (PS(self.realowner).m_switchweapon != WEP_SEEKER))
+       if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.(thiswep.ammo_field) < WEP_CVAR(seeker, missile_ammo)) || (self.cnt <= -1) || (IS_DEAD(self.realowner)) || (PS(self.realowner).m_switchweapon != WEP_SEEKER))
        {
                remove(self);
                return;
@@ -459,7 +459,7 @@ void W_Seeker_Vollycontroller_Think() // TODO: Merge this with W_Seeker_Attack
 void W_Seeker_Tracker_Think()
 {SELFPARAM();
        // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
-       if((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (PS(self.realowner).m_switchweapon != WEP_SEEKER)
+       if((IS_DEAD(self.realowner)) || (IS_DEAD(self.tag_target)) || (PS(self.realowner).m_switchweapon != WEP_SEEKER)
        || (time > self.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
        {
                if(self)
@@ -511,7 +511,7 @@ void W_Seeker_Tag_Touch()
        self.event_damage = func_null;
        Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY, other.species, self);
 
-       if(other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
+       if(other.takedamage == DAMAGE_AIM && !IS_DEAD(other))
        {
                // check to see if this person is already tagged by me
                entity tag = W_Seeker_Tagged_Info(self.realowner, other);
index fb5fbf4bbb96fa36bb97a4ed3960b3e7630017c2..645955f03fadd14411537566cfafe6b0b56d60d6 100644 (file)
@@ -120,7 +120,7 @@ void W_Shockwave_Melee_Think()
        vector targpos;
 
        // check to see if we can still continue, otherwise give up now
-       if((self.realowner.deadflag != DEAD_NO) && WEP_CVAR(shockwave, melee_no_doubleslap))
+       if(IS_DEAD(self.realowner) && WEP_CVAR(shockwave, melee_no_doubleslap))
        {
                remove(self);
                return;
index 8e4570e5aafc3f93025b75b5a209f1410c75ad03..928ec4bef92d324a608fe8677eafa052eb532c9a 100644 (file)
@@ -108,7 +108,7 @@ void W_Shotgun_Melee_Think()
        f = ((1 - swing) * WEP_CVAR_SEC(shotgun, melee_traces));
 
        // check to see if we can still continue, otherwise give up now
-       if((self.realowner.deadflag != DEAD_NO) && WEP_CVAR_SEC(shotgun, melee_no_doubleslap))
+       if(IS_DEAD(self.realowner) && WEP_CVAR_SEC(shotgun, melee_no_doubleslap))
        {
                remove(self);
                return;
index f7c14d9f6f492e3185139b7228b56e7fd46c6c38..118aa72a166c3a10662397747edbaf3536af6182 100644 (file)
@@ -217,7 +217,7 @@ void W_RocketMinsta_Laser_Explode ()
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
-                               if(other.deadflag == DEAD_NO)
+                               if(!IS_DEAD(other))
                                        if(IsFlying(other))
                                                Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
 
index ee7d39d17d46086aac8a07dccb96da61e91a7e68..134e78401f9c2d5eba5ff53c8d366a36d9eb250f 100644 (file)
@@ -38,7 +38,7 @@ void havocbot_ai()
 
                // TODO: tracewalk() should take care of this job (better path finding under water)
                // if we don't have a goal and we're under water look for a waypoint near the "shore" and push it
-               if(self.deadflag != DEAD_NO)
+               if(IS_DEAD(self))
                if(self.goalcurrent==world)
                if(self.waterlevel==WATERLEVEL_SWIMMING || (self.aistatus & AI_STATUS_OUT_WATER))
                {
@@ -86,7 +86,7 @@ void havocbot_ai()
                bot_strategytoken_taken = true;
        }
 
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        havocbot_chooseenemy();
index f49800ff9063f9aa530f321081d5b30b7c8076d3..b7f459afe0acdfcee1b242357c5c9392a6d3ec7c 100644 (file)
@@ -63,7 +63,7 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                {
                        discard = false;
 
-                       FOREACH_CLIENT(IS_PLAYER(it) && it != self && it.deadflag == DEAD_NO, LAMBDA(
+                       FOREACH_CLIENT(IS_PLAYER(it) && it != self && !IS_DEAD(it), LAMBDA(
                                d = vlen(it.origin - o); // distance between player and item
 
                                if ( it.team == self.team )
@@ -201,7 +201,7 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
 // go to best items
 void havocbot_role_generic()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (self.bot_strategytime < time)
index 998f08c785e73b9966cd016921bf31c58d026e6a..e2e505acef4cec7c180c5c3ec70ef5956b18bd6f 100644 (file)
@@ -1130,7 +1130,7 @@ void botframe_deleteuselesswaypoints()
 
 void botframe_autowaypoints()
 {
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.deadflag == DEAD_NO, LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && !IS_DEAD(it), LAMBDA(
                // going back is broken, so only fix waypoints to walk TO the player
                //botframe_autowaypoints_fix(p, false, botframe_autowaypoints_lastwp0);
                botframe_autowaypoints_fix(it, true, botframe_autowaypoints_lastwp1);
index 453b2ca2b5a0d5990ecc3de7e7ee83401af944f1..e7a13b3f90d4e46dd3bfb76e022d8dc21744d031 100644 (file)
@@ -60,7 +60,7 @@ void CheatShutdownClient()
 float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as argument for possible future ACL checking
 {SELFPARAM();
        // dead people cannot cheat
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return 0;
        if(gamestart_sv_cheats < 2 && !IS_PLAYER(self))
                return 0;
@@ -228,7 +228,7 @@ float CheatImpulse(int imp)
                                DID_CHEAT();
                                break;
                        }
-                       if(self.deadflag != DEAD_NO)
+                       if(IS_DEAD(self))
                                sprint(self, "UR DEAD AHAHAH))\n");
                        else
                                sprint(self, "No waypoint set, cheater (use g_waypointsprite_personal to set one)\n");
@@ -265,7 +265,7 @@ float CheatImpulse(int imp)
                case CHIMPULSE_R00T.impulse:
                        IS_CHEAT(imp, 0, 0);
                        RandomSelection_Init();
-                       FOREACH_CLIENT(IS_PLAYER(it) && it.deadflag == DEAD_NO && DIFF_TEAM(it, self), LAMBDA(RandomSelection_Add(it, 0, string_null, 1, 1)));
+                       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, self), LAMBDA(RandomSelection_Add(it, 0, string_null, 1, 1)));
                        if(RandomSelection_chosen_ent)
                                e = RandomSelection_chosen_ent;
                        else
@@ -1018,7 +1018,7 @@ void Drag_Update(entity dragger)
 
 float Drag_CanDrag(entity dragger)
 {
-       return (dragger.deadflag == DEAD_NO) || (IS_PLAYER(dragger));
+       return (!IS_DEAD(dragger)) || (IS_PLAYER(dragger));
 }
 
 float Drag_IsDragging(entity dragger)
index 25750e97202a70f5a7c24271fa66e4709f58437a..637530cbfe630f9ecaeaf3ae4ce49ac11f41683c 100644 (file)
@@ -835,13 +835,13 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
 
     if(!self.killindicator)
        {
-               if(self.deadflag == DEAD_NO)
+               if(!IS_DEAD(self))
                {
                        killtime = max(killtime, self.clientkill_nexttime - time);
                        self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
                }
 
-               if(killtime <= 0 || !IS_PLAYER(self) || self.deadflag != DEAD_NO)
+               if(killtime <= 0 || !IS_PLAYER(self) || IS_DEAD(self))
                {
                        ClientKill_Now();
                }
@@ -1791,7 +1791,7 @@ Update a respawn countdown display.
 void ShowRespawnCountdown()
 {SELFPARAM();
        float number;
-       if(self.deadflag == DEAD_NO) // just respawned?
+       if(!IS_DEAD(self)) // just respawned?
                return;
        else
        {
@@ -2050,7 +2050,7 @@ void PlayerUseKey()
        else if(autocvar_g_vehicles_enter)
        {
                if(!self.frozen)
-               if(self.deadflag == DEAD_NO)
+               if(!IS_DEAD(self))
                if(!gameover)
                {
                        entity head, closest_target = world;
@@ -2059,7 +2059,7 @@ void PlayerUseKey()
                        while(head) // find the closest acceptable target to enter
                        {
                                if(head.vehicle_flags & VHF_ISVEHICLE)
-                               if(head.deadflag == DEAD_NO)
+                               if(!IS_DEAD(head))
                                if(!head.owner || ((head.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(head.owner, self)))
                                if(head.takedamage != DAMAGE_NO)
                                {
@@ -2209,12 +2209,12 @@ void PlayerPreThink ()
        if(!gameover)
        if(!self.frozen)
        if(!self.vehicle)
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
        {
                entity veh;
                for(veh = world; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); )
                if(vlen(veh.origin - self.origin) < autocvar_g_vehicles_enter_radius)
-               if(veh.deadflag == DEAD_NO)
+               if(!IS_DEAD(veh))
                if(veh.takedamage != DAMAGE_NO)
                if((veh.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(veh.owner, self))
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER);
@@ -2261,7 +2261,7 @@ void PlayerPreThink ()
                        player_powerups();
                }
 
-               if (self.deadflag != DEAD_NO)
+               if (IS_DEAD(self))
                {
                        if(self.personal && g_race_qualifying)
                        {
@@ -2465,7 +2465,7 @@ void PlayerPreThink ()
 
 void DrownPlayer(entity this)
 {
-       if(this.deadflag != DEAD_NO)
+       if(IS_DEAD(this))
                return;
 
        if (this.waterlevel != WATERLEVEL_SUBMERGED)
index c29c10f26bf5ac8f5f8390352011c6125cc472e2..917a95f178ef8ed23bbb653f427c287ce01db4d3 100644 (file)
@@ -53,7 +53,7 @@
 #define X(slot) \
        IMPULSE(weapon_group_##slot) \
        { \
-               if (this.deadflag != DEAD_NO) return; \
+               if (IS_DEAD(this)) return; \
                W_NextWeaponOnImpulse(slot); \
        }
 X(1)
@@ -74,7 +74,7 @@ X(0)
        IMPULSE(weapon_priority_##slot##_##dir) \
        { \
                if (this.vehicle) return; \
-               if (this.deadflag != DEAD_NO) return; \
+               if (IS_DEAD(this)) return; \
                noref int prev = -1; \
                noref int best =  0; \
                noref int next = +1; \
@@ -120,7 +120,7 @@ X(9, next)
        IMPULSE(weapon_byid_##i) \
        { \
                if (this.vehicle) return; \
-               if (this.deadflag != DEAD_NO) return; \
+               if (IS_DEAD(this)) return; \
                W_SwitchWeapon(Weapons_from(WEP_FIRST + i)); \
        }
 X(0)
@@ -152,70 +152,70 @@ X(23)
 IMPULSE(weapon_next_byid)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_NextWeapon(0);
 }
 
 IMPULSE(weapon_prev_byid)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_PreviousWeapon(0);
 }
 
 IMPULSE(weapon_next_bygroup)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_NextWeapon(1);
 }
 
 IMPULSE(weapon_prev_bygroup)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_PreviousWeapon(1);
 }
 
 IMPULSE(weapon_next_bypriority)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_NextWeapon(2);
 }
 
 IMPULSE(weapon_prev_bypriority)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_PreviousWeapon(2);
 }
 
 IMPULSE(weapon_last)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_LastWeapon(this);
 }
 
 IMPULSE(weapon_best)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_SwitchWeapon(w_getbestweapon(this));
 }
 
 IMPULSE(weapon_drop)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        W_ThrowWeapon(W_CalculateProjectileVelocity(this.velocity, v_forward * 750, false), '0 0 0', true);
 }
 
 IMPULSE(weapon_reload)
 {
        if (this.vehicle) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        if (forbidWeaponUse(this)) return;
        Weapon w = PS(this).m_weapon;
        entity actor = this;
@@ -363,7 +363,7 @@ IMPULSE(waypoint_personal_death)
 IMPULSE(waypoint_here_follow)
 {
        if (!teamplay) return;
-       if (this.deadflag != DEAD_NO) return;
+       if (IS_DEAD(this)) return;
        if (!MUTATOR_CALLHOOK(HelpMePing, this))
        {
                entity wp = WaypointSprite_Attach(WP_Helpme, true, RADARICON_HELPME);
index 1900989e663f3c0bf50b731bfdf68bb7a87af90b..3261d3eb019ae1a22fa6cbdcb3037bbad42aab07 100644 (file)
@@ -372,7 +372,7 @@ void ClientCommand_selectteam(float request, float argc)
 
                                                                if (selection)
                                                                {
-                                                                       if (self.team == selection && self.deadflag == DEAD_NO)
+                                                                       if (self.team == selection && !IS_DEAD(self))
                                                                        {
                                                                                sprint(self, "^7You already are on that team.\n");
                                                                        }
index c03b874d1ba17d43115174053d0e839aa8b3638b..b8e396682f43e41c001698515cf16f6e7c1bf48a 100644 (file)
@@ -378,7 +378,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                        if (MUTATOR_CALLHOOK(AllowMobSpawning)) { print_to(caller, ret_string); return; }
                                        if (caller.vehicle) { print_to(caller, "You can't spawn monsters while driving a vehicle"); return; }
                                        if (caller.frozen) { print_to(caller, "You can't spawn monsters while frozen"); return; }
-                                       if (caller.deadflag != DEAD_NO) { print_to(caller, "You can't spawn monsters while dead"); return; }
+                                       if (IS_DEAD(caller)) { print_to(caller, "You can't spawn monsters while dead"); return; }
                                        if (tmp_moncount >= autocvar_g_monsters_max) { print_to(caller, "The maximum monster count has been reached"); return; }
                                        if (tmp_moncount >= autocvar_g_monsters_max_perplayer) { print_to(caller, "You can't spawn any more monsters"); return; }
 
index a1c4d60e0ab4c1de9dfc4301572c12aa5eb00026..61ece1f59c9b05daf250ba25378979f91c0e53a5 100644 (file)
@@ -643,7 +643,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                                damage = 0;
                                        else if(autocvar_teamplay_mode == 4)
                                        {
-                                               if(IS_PLAYER(targ) && targ.deadflag == DEAD_NO)
+                                               if(IS_PLAYER(targ) && !IS_DEAD(targ))
                                                {
                                                        attacker.dmg_team = attacker.dmg_team + damage;
                                                        complainteamdamage = attacker.dmg_team - autocvar_g_teamdamage_threshold;
@@ -1230,7 +1230,7 @@ void Fire_ApplyDamage(entity e)
        if(!IS_INDEPENDENT_PLAYER(e))
        if(!e.frozen)
                FOREACH_CLIENT(IS_PLAYER(it) && it != e, LAMBDA(
-                       if(it.deadflag == DEAD_NO)
+                       if(!IS_DEAD(it))
                        if(!IS_INDEPENDENT_PLAYER(it))
                        if(boxesoverlap(e.absmin, e.absmax, it.absmin, it.absmax))
                        {
index c536ceaa2d708c1cd8a4442e7adcd97e8d5e37bc..b49b2160ed0a2860f2d98b81d90c0f473760fed9 100644 (file)
@@ -1496,7 +1496,7 @@ void CheckRules_Player()
        if (gameover)   // someone else quit the game already
                return;
 
-       if(self.deadflag == DEAD_NO)
+       if(!IS_DEAD(self))
                self.play_time += frametime;
 
        // fixme: don't check players; instead check spawnfunc_dom_team and spawnfunc_ctf_team entities
@@ -1718,7 +1718,7 @@ float WinningCondition_RanOutOfSpawns()
 
        team1_score = team2_score = team3_score = team4_score = 0;
 
-       FOREACH_CLIENT(IS_PLAYER(it) && it.deadflag == DEAD_NO, LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
                switch(it.team)
                {
                        case NUM_TEAM_1: team1_score = 1; break;
index 6aabed2db7ebd6f602dfa60d7865027aa05b2a3d..7cdd00f41a3fd5172f521c929bd9c1eed12dfec3 100644 (file)
@@ -481,7 +481,7 @@ void havocbot_goalrating_ast_targets(float ratingscale)
 
 void havocbot_role_ast_offense()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                self.havocbot_attack_time = 0;
                havocbot_ast_reset_role(self);
@@ -515,7 +515,7 @@ void havocbot_role_ast_offense()
 
 void havocbot_role_ast_defense()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                self.havocbot_attack_time = 0;
                havocbot_ast_reset_role(self);
@@ -566,7 +566,7 @@ void havocbot_role_ast_setrole(entity bot, float role)
 
 void havocbot_ast_reset_role(entity bot)
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if(bot.team == assault_attacker_team)
index e70a5d3c8edb49703b3e80d0fedfa4e1a1062656..e2056a407e14b72e679e1c6e6d9a362f77e1cb52 100644 (file)
@@ -60,10 +60,10 @@ void CA_count_alive_players()
        FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
                switch(it.team)
                {
-                       case NUM_TEAM_1: ++total_players; if(it.deadflag == DEAD_NO) ++redalive; break;
-                       case NUM_TEAM_2: ++total_players; if(it.deadflag == DEAD_NO) ++bluealive; break;
-                       case NUM_TEAM_3: ++total_players; if(it.deadflag == DEAD_NO) ++yellowalive; break;
-                       case NUM_TEAM_4: ++total_players; if(it.deadflag == DEAD_NO) ++pinkalive; break;
+                       case NUM_TEAM_1: ++total_players; if(!IS_DEAD(it)) ++redalive; break;
+                       case NUM_TEAM_2: ++total_players; if(!IS_DEAD(it)) ++bluealive; break;
+                       case NUM_TEAM_3: ++total_players; if(!IS_DEAD(it)) ++yellowalive; break;
+                       case NUM_TEAM_4: ++total_players; if(!IS_DEAD(it)) ++pinkalive; break;
                }
        ));
        FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
@@ -178,7 +178,7 @@ bool CA_CheckTeams()
 
 bool ca_isEliminated(entity e)
 {
-       if(e.caplayer == 1 && (e.deadflag != DEAD_NO || e.frags == FRAGS_LMS_LOSER))
+       if(e.caplayer == 1 && (IS_DEAD(e) || e.frags == FRAGS_LMS_LOSER))
                return true;
        if(e.caplayer == 0.5)
                return true;
@@ -270,7 +270,7 @@ entity ca_LastPlayerForTeam()
 {SELFPARAM();
        entity last_pl = world;
        FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA(
-               if(it.deadflag == DEAD_NO)
+               if(!IS_DEAD(it))
                if(SAME_TEAM(self, it))
                if(!last_pl)
                        last_pl = it;
@@ -355,7 +355,7 @@ MUTATOR_HOOKFUNCTION(ca, SetStartItems)
 MUTATOR_HOOKFUNCTION(ca, PlayerDamage_Calculate)
 {
        if(IS_PLAYER(frag_target))
-       if(frag_target.deadflag == DEAD_NO)
+       if(!IS_DEAD(frag_target))
        if(frag_target == frag_attacker || SAME_TEAM(frag_target, frag_attacker) || frag_deathtype == DEATH_FALL.m_id)
                frag_damage = 0;
 
index df72b097e01d501b603d7458227bc4b06a3228ce..a753ec102b7009adf7c8e9b966603785e903add4 100644 (file)
@@ -1144,7 +1144,7 @@ void ctf_FlagThink()
                        WarpZone_TraceLine(self.origin, targ_origin, MOVE_NOMONSTERS, self);
 
                        if((self.pass_target == world)
-                               || (self.pass_target.deadflag != DEAD_NO)
+                               || (IS_DEAD(self.pass_target))
                                || (self.pass_target.flagcarried)
                                || (vlen(self.origin - targ_origin) > autocvar_g_ctf_pass_radius)
                                || ((trace_fraction < 1) && (trace_ent != self.pass_target))
@@ -1215,7 +1215,7 @@ METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher))
                }
                return;
        }
-       else if(toucher.deadflag != DEAD_NO) { return; }
+       else if(IS_DEAD(toucher)) { return; }
 
        switch(flag.ctf_status)
        {
@@ -1257,7 +1257,7 @@ METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher))
 
                case FLAG_PASSING:
                {
-                       if((IS_PLAYER(toucher)) && (toucher.deadflag == DEAD_NO) && (toucher != flag.pass_sender))
+                       if((IS_PLAYER(toucher)) && !IS_DEAD(toucher) && (toucher != flag.pass_sender))
                        {
                                if(DIFF_TEAM(toucher, flag.pass_sender))
                                        ctf_Handle_Return(flag, toucher);
@@ -1540,7 +1540,7 @@ int havocbot_ctf_teamcount(entity bot, vector org, float tc_radius)
        int c = 0;
 
        FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-               if(DIFF_TEAM(it, bot) || it.deadflag != DEAD_NO || it == bot)
+               if(DIFF_TEAM(it, bot) || IS_DEAD(it) || it == bot)
                        continue;
 
                if(vlen(it.origin - org) < tc_radius)
@@ -1688,7 +1688,7 @@ void havocbot_ctf_reset_role(entity bot)
        entity mf, ef;
        float c;
 
-       if(bot.deadflag != DEAD_NO)
+       if(IS_DEAD(bot))
                return;
 
        if(vlen(havocbot_ctf_middlepoint)==0)
@@ -1748,7 +1748,7 @@ void havocbot_ctf_reset_role(entity bot)
 
 void havocbot_role_ctf_carrier()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                havocbot_ctf_reset_role(self);
                return;
@@ -1791,7 +1791,7 @@ void havocbot_role_ctf_escort()
 {SELFPARAM();
        entity mf, ef;
 
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                havocbot_ctf_reset_role(self);
                return;
@@ -1852,7 +1852,7 @@ void havocbot_role_ctf_offense()
        entity mf, ef;
        vector pos;
 
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                havocbot_ctf_reset_role(self);
                return;
@@ -1933,7 +1933,7 @@ void havocbot_role_ctf_retriever()
 {SELFPARAM();
        entity mf;
 
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                havocbot_ctf_reset_role(self);
                return;
@@ -1981,7 +1981,7 @@ void havocbot_role_ctf_middle()
 {SELFPARAM();
        entity mf;
 
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                havocbot_ctf_reset_role(self);
                return;
@@ -2032,7 +2032,7 @@ void havocbot_role_ctf_defense()
 {SELFPARAM();
        entity mf;
 
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
        {
                havocbot_ctf_reset_role(self);
                return;
@@ -2074,7 +2074,7 @@ void havocbot_role_ctf_defense()
                // if enemies are closer to our base, go there
                entity closestplayer = world;
                float distance, bestdistance = 10000;
-               FOREACH_CLIENT(IS_PLAYER(it) && it.deadflag == DEAD_NO, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
                        distance = vlen(org - it.origin);
                        if(distance<bestdistance)
                        {
@@ -2215,7 +2215,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerDamage_Calculate) // for changing damage and for
                        frag_force *= autocvar_g_ctf_flagcarrier_forcefactor;
                }
        }
-       else if(frag_target.flagcarried && (frag_target.deadflag == DEAD_NO) && CTF_DIFFTEAM(frag_target, frag_attacker)) // if the target is a flagcarrier
+       else if(frag_target.flagcarried && !IS_DEAD(frag_target) && CTF_DIFFTEAM(frag_target, frag_attacker)) // if the target is a flagcarrier
        {
                if(autocvar_g_ctf_flagcarrier_auto_helpme_damage > ('1 0 0' * healtharmor_maxdamage(frag_target.health, frag_target.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id)))
                if(time > frag_target.wps_helpme_time + autocvar_g_ctf_flagcarrier_auto_helpme_time)
@@ -2292,7 +2292,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey)
 
        entity player = self;
 
-       if((time > player.throw_antispam) && (player.deadflag == DEAD_NO) && !player.speedrunning && (!player.vehicle || autocvar_g_ctf_allow_vehicle_touch))
+       if((time > player.throw_antispam) && !IS_DEAD(player) && !player.speedrunning && (!player.vehicle || autocvar_g_ctf_allow_vehicle_touch))
        {
                // pass the flag to a team mate
                if(autocvar_g_ctf_pass)
@@ -2302,7 +2302,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey)
 
                        while(head) // find the closest acceptable target to pass to
                        {
-                               if(IS_PLAYER(head) && head.deadflag == DEAD_NO)
+                               if(IS_PLAYER(head) && !IS_DEAD(head))
                                if(head != player && SAME_TEAM(head, player))
                                if(!head.speedrunning && !head.vehicle)
                                {
index 1d43be9522fa9bada7acd3204c95f3d90f36d79d..b442b0706d213fbd5dfe8507ecdde377708bea8e 100644 (file)
@@ -53,7 +53,7 @@ bool autocvar_g_cts_selfdamage;
 .float race_checkpoint;
 void havocbot_role_cts()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        entity e;
index 277110667f9f90eee8e4d8c2976e57f8cc3cb65c..76be449870d056f3de0ecea092726d09deff07ee 100644 (file)
@@ -452,7 +452,7 @@ void Domination_RoundStart()
 //go to best items, or control points you don't own
 void havocbot_role_dom()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (self.bot_strategytime < time)
index d7b01a0d4ac990509b263dc5aae9e150432bcdf6..6f904a1c9487ad1c1fe7e59b2b44cb57d7644e95 100644 (file)
@@ -252,7 +252,7 @@ void freezetag_Unfreeze(entity attacker)
 
 float freezetag_isEliminated(entity e)
 {
-       if(IS_PLAYER(e) && (e.frozen == 1 || e.deadflag != DEAD_NO))
+       if(IS_PLAYER(e) && (e.frozen == 1 || IS_DEAD(e)))
                return true;
        return false;
 }
@@ -288,7 +288,7 @@ void havocbot_goalrating_freeplayers(float ratingscale, vector org, float sradiu
 
 void havocbot_role_ft_offense()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (!self.havocbot_role_timeout)
@@ -322,7 +322,7 @@ void havocbot_role_ft_offense()
 
 void havocbot_role_ft_freeing()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (!self.havocbot_role_timeout)
@@ -502,7 +502,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
                n = 0;
                FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA(
                        if(it.frozen == 0)
-                       if(it.deadflag == DEAD_NO)
+                       if(!IS_DEAD(it))
                        if(SAME_TEAM(it, self))
                        if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, it.absmin, it.absmax))
                        {
index 1e593d0eff0afdac49d2e5a5cbb28cc55bb6cfb5..9925cf5cafb313ae726eb73f084752118e52cb7a 100644 (file)
@@ -132,7 +132,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
                ka_RespawnBall();
                return;
        }
-       if(other.deadflag != DEAD_NO) { return; }
+       if(IS_DEAD(other)) { return; }
        if(other.frozen) { return; }
        if (!IS_PLAYER(other))
        {  // The ball just touched an object, most likely the world
@@ -263,7 +263,7 @@ void havocbot_goalrating_ball(float ratingscale, vector org)
 
 void havocbot_role_ka_carrier()
 {SELFPARAM();
-       if (self.deadflag != DEAD_NO)
+       if (IS_DEAD(self))
                return;
 
        if (time > self.bot_strategytime)
@@ -286,7 +286,7 @@ void havocbot_role_ka_carrier()
 
 void havocbot_role_ka_collector()
 {SELFPARAM();
-       if (self.deadflag != DEAD_NO)
+       if (IS_DEAD(self))
                return;
 
        if (time > self.bot_strategytime)
index 6a4812e58717b37bbf3e9912c57de9ef2cb90e87..c6b9b4c15d8fc6b580b74e79f1ef112f4d377df7 100644 (file)
@@ -522,7 +522,7 @@ void kh_Key_Touch()  // runs many, many times when a key has been dropped and ca
 
        if (!IS_PLAYER(other))
                return;
-       if(other.deadflag != DEAD_NO)
+       if(IS_DEAD(other))
                return;
        if(other == self.enemy)
                if(time < self.kh_droptime + autocvar_g_balance_keyhunt_delay_collect)
@@ -919,7 +919,7 @@ float kh_CheckPlayers(float num)
                float t_team = kh_Team_ByID(num);
                float players = 0;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(it.deadflag == DEAD_NO && !it.BUTTON_CHAT && it.team == t_team)
+                       if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == t_team)
                                ++players;
                ));
 
@@ -1005,7 +1005,7 @@ void kh_StartRound()  // runs at the start of each round
                players = 0;
                entity my_player = world;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(it.deadflag == DEAD_NO && !it.BUTTON_CHAT && it.team == teem)
+                       if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == teem)
                        {
                                ++players;
                                if(random() * players <= 1)
@@ -1127,7 +1127,7 @@ void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, f
 
 void havocbot_role_kh_carrier()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (!(self.kh_next))
@@ -1154,7 +1154,7 @@ void havocbot_role_kh_carrier()
 
 void havocbot_role_kh_defense()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (self.kh_next)
@@ -1195,7 +1195,7 @@ void havocbot_role_kh_defense()
 
 void havocbot_role_kh_offense()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (self.kh_next)
@@ -1237,7 +1237,7 @@ void havocbot_role_kh_offense()
 
 void havocbot_role_kh_freelancer()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        if (self.kh_next)
@@ -1352,7 +1352,7 @@ MUTATOR_HOOKFUNCTION(kh, PlayerUseKey)
 
 MUTATOR_HOOKFUNCTION(kh, HavocBot_ChooseRole)
 {
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return true;
 
        float r = random() * 3;
index 2e28c80080db380decfb1b8b33c73906d38263a8..9d2dcbf4aa22b0ad62217dd059d62981f06eda68 100644 (file)
@@ -53,7 +53,7 @@ int autocvar_g_race_teams;
 .float race_checkpoint;
 void havocbot_role_race()
 {SELFPARAM();
-       if(self.deadflag != DEAD_NO)
+       if(IS_DEAD(self))
                return;
 
        entity e;
index ecaaad5bbb16610711d86b1f23af3e3febf2a850..0cac389aaf753368f18ce4e52b23a5fb6357d5a1 100644 (file)
@@ -1028,7 +1028,7 @@ void race_AbandonRaceCheck(entity p)
 void race_StartCompleting()
 {
        race_completing = 1;
-       FOREACH_CLIENT(IS_PLAYER(it) && it.deadflag != DEAD_NO, LAMBDA(race_AbandonRaceCheck(it)));
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_DEAD(it), LAMBDA(race_AbandonRaceCheck(it)));
 }
 
 void race_PreparePlayer()
index 71f3bf48a796dfb136d8e7bc89197fdb49a46a69..34ee3277a5fa6ce755520cfe520db6f29e030fe9 100644 (file)
@@ -568,7 +568,7 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
 
                LogTeamchange(pl.playerid, pl.team, 2); // log auto join
 
-               if(pl.deadflag == DEAD_NO)
+               if(!IS_DEAD(pl))
                        Damage(pl, pl, pl, 100000, DEATH_TEAMCHANGE.m_id, pl.origin, '0 0 0');
        }
 
@@ -660,7 +660,7 @@ void SV_ChangeTeam(float _color)
        if(IS_PLAYER(self) && steam != dteam)
        {
                // kill player when changing teams
-               if(self.deadflag == DEAD_NO)
+               if(!IS_DEAD(self))
                        Damage(self, self, self, 100000, DEATH_TEAMCHANGE.m_id, self.origin, '0 0 0');
        }
 }
@@ -797,7 +797,7 @@ void ShufflePlayerOutOfTeam (float source_team)
        TeamchangeFrags(selected);
        SetPlayerTeam(selected, smallestteam, source_team, false);
 
-       if(selected.deadflag == DEAD_NO)
+       if(!IS_DEAD(selected))
                Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE.m_id, selected.origin, '0 0 0');
        Send_Notification(NOTIF_ONE, selected, MSG_CENTER, CENTER_DEATH_SELF_AUTOTEAMCHANGE, selected.team);
 }
index 6f7ef30d285d625fb923adeec30c23938f90ef1f..17bf1221890cde38edf309debefab72a3070fce4 100644 (file)
@@ -93,7 +93,7 @@ bool accuracy_isgooddamage(entity attacker, entity targ)
        int mutator_check = MUTATOR_CALLHOOK(AccuracyTargetValid, attacker, targ);
 
        if (warmup_stage) return false;
-       if (targ.deadflag != DEAD_NO) return false;
+       if (IS_DEAD(targ)) return false;
        if (targ.frozen) return false;
        if (SAME_TEAM(attacker, targ)) return false;
 
index 83ecd65e354d4077444c2228a1763858dbc2031f..c6a8faeb2f3d8a0534f5510ac4cada1fe791bb4c 100644 (file)
@@ -74,7 +74,7 @@ void CL_Weaponentity_Think()
                remove(this);
                return;
        }
-       if (this.owner.deadflag != DEAD_NO)
+       if (IS_DEAD(self.owner))
        {
                // owner died; disappear
                this.model = "";
@@ -115,7 +115,7 @@ void CL_ExteriorWeaponentity_Think()
                remove(this);
                return;
        }
-       if (this.owner.deadflag != DEAD_NO)
+       if (IS_DEAD(self.owner))
        {
                this.model = "";
                return;