From: Mario Date: Thu, 31 Dec 2015 19:59:05 +0000 (+1000) Subject: Use IS_DEAD everywhere X-Git-Tag: xonotic-v0.8.2~1339 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0dbdb22db2053df47bd9c2d871540a0e42ea0521;p=xonotic%2Fxonotic-data.pk3dir.git Use IS_DEAD everywhere --- diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index d5324ca6f..d895d75c6 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -354,7 +354,7 @@ 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; diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 4a8005d6c..d8be44d0d 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -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 ) { diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index c0f2eac21..d75003346 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -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 ) diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index ac5dd514c..14d30cd27 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -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) diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 8dff94a6a..0ec5f78ff 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -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); diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 9a934ba74..684d1615f 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -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) diff --git a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc index ca3716669..54e8237ec 100644 --- a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc +++ b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc @@ -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; diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index 2c6bcfb41..e16dc8f93 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -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) diff --git a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc index 0ba0bb64e..0c4a88d61 100644 --- a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc +++ b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc @@ -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) diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index cfac98232..3fd4d6ce5 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -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)) diff --git a/qcsrc/common/mutators/mutator/nix/nix.qc b/qcsrc/common/mutators/mutator/nix/nix.qc index c3aadca41..d265d3318 100644 --- a/qcsrc/common/mutators/mutator/nix/nix.qc +++ b/qcsrc/common/mutators/mutator/nix/nix.qc @@ -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; diff --git a/qcsrc/common/mutators/mutator/overkill/overkill.qc b/qcsrc/common/mutators/mutator/overkill/overkill.qc index d50c75bef..758437ef0 100644 --- a/qcsrc/common/mutators/mutator/overkill/overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/overkill.qc @@ -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) diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc index f8a66eaef..80bf57a3e 100644 --- a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc @@ -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 diff --git a/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc b/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc index 2b9ca637d..d7ba22216 100644 --- a/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc +++ b/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc @@ -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)) { diff --git a/qcsrc/common/mutators/mutator/vampire/vampire.qc b/qcsrc/common/mutators/mutator/vampire/vampire.qc index 315da7dc6..6a2e1fdb7 100644 --- a/qcsrc/common/mutators/mutator/vampire/vampire.qc +++ b/qcsrc/common/mutators/mutator/vampire/vampire.qc @@ -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); diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 97fc76c09..945abd531 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -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; diff --git a/qcsrc/common/triggers/platforms.qc b/qcsrc/common/triggers/platforms.qc index 5eb47fa36..c834a06a2 100644 --- a/qcsrc/common/triggers/platforms.qc +++ b/qcsrc/common/triggers/platforms.qc @@ -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 diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 1050f8ebd..b4dc20a7d 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -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 diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 10d422fd6..c83ea06fa 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -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 diff --git a/qcsrc/common/triggers/trigger/magicear.qc b/qcsrc/common/triggers/trigger/magicear.qc index c20514e1a..f973c7a6f 100644 --- a/qcsrc/common/triggers/trigger/magicear.qc +++ b/qcsrc/common/triggers/trigger/magicear.qc @@ -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) diff --git a/qcsrc/common/triggers/trigger/viewloc.qc b/qcsrc/common/triggers/trigger/viewloc.qc index a6d9418b3..f7e694952 100644 --- a/qcsrc/common/triggers/trigger/viewloc.qc +++ b/qcsrc/common/triggers/trigger/viewloc.qc @@ -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; diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index fc10451d3..02655d6b2 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -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? diff --git a/qcsrc/common/turrets/turret/fusionreactor.qc b/qcsrc/common/turrets/turret/fusionreactor.qc index 889ba79a0..4f3e7cc70 100644 --- a/qcsrc/common/turrets/turret/fusionreactor.qc +++ b/qcsrc/common/turrets/turret/fusionreactor.qc @@ -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) diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qc b/qcsrc/common/turrets/turret/hellion_weapon.qc index 5b7f42f45..4a559b08e 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qc +++ b/qcsrc/common/turrets/turret/hellion_weapon.qc @@ -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 diff --git a/qcsrc/common/turrets/turret/hk_weapon.qc b/qcsrc/common/turrets/turret/hk_weapon.qc index b24623097..58c22a79b 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qc +++ b/qcsrc/common/turrets/turret/hk_weapon.qc @@ -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; } diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qc b/qcsrc/common/turrets/turret/phaser_weapon.qc index 087ade8d4..8c1134eaf 100644 --- a/qcsrc/common/turrets/turret/phaser_weapon.qc +++ b/qcsrc/common/turrets/turret/phaser_weapon.qc @@ -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; diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index c541f9131..caec87278 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -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) diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index cd9efff07..c72c60807 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -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; } diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 26e64d0d2..ad236e07e 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index da89dc0aa..5da6cae37 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qc b/qcsrc/common/vehicles/vehicle/racer_weapon.qc index 678f9af0b..a4cf0dde2 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qc +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 7ebac8152..f212b4ce4 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc index 12007fc39..7a657961d 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc @@ -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(); } diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 959e0939d..f34006b67 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -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 ) || diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index ba1e9b0fe..455567a2f 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -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; diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 69e925d11..d632d7776 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -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) diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index a72ff3927..fd1f74ecd 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -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); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 17ef5847a..872568817 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -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 diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index bac1ef3d5..a19f38dc0 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -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); diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 59731c954..580a5bece 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -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); diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 911ebb07d..c777562e4 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -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); diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index fb5fbf4bb..645955f03 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -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; diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 8e4570e5a..928ec4bef 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -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; diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index f7c14d9f6..118aa72a1 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -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); diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index ee7d39d17..134e78401 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -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(); diff --git a/qcsrc/server/bot/havocbot/roles.qc b/qcsrc/server/bot/havocbot/roles.qc index f49800ff9..b7f459afe 100644 --- a/qcsrc/server/bot/havocbot/roles.qc +++ b/qcsrc/server/bot/havocbot/roles.qc @@ -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) diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index 998f08c78..e2e505ace 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -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); diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 453b2ca2b..e7a13b3f9 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -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) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 25750e972..637530cbf 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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) diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index c29c10f26..917a95f17 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -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); diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 1900989e6..3261d3eb0 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -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"); } diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index c03b874d1..b8e396682 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -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; } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index a1c4d60e0..61ece1f59 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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)) { diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index c536ceaa2..b49b2160e 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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; diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index 6aabed2db..7cdd00f41 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -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) diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index e70a5d3c8..e2056a407 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -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; diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index df72b097e..a753ec102 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -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 ('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) { diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index 1d43be952..b442b0706 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -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; diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index 277110667..76be44987 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -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) diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index d7b01a0d4..6f904a1c9 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -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)) { diff --git a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc index 1e593d0ef..9925cf5ca 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc @@ -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) diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 6a4812e58..c6b9b4c15 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -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; diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index 2e28c8008..9d2dcbf4a 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -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; diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index ecaaad5bb..0cac389aa 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -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() diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 71f3bf48a..34ee3277a 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -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); } diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 6f7ef30d2..17bf12218 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -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; diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 83ecd65e3..c6a8faeb2 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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;