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;
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 )
{
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)
{
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 )
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);
void havocbot_ons_reset_role(entity bot)
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
bot.havocbot_ons_target = world;
{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 )
);
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)
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);
|| (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)
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)
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;
}
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;
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)
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)
{
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)
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)
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)
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;
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;
if(gameover)
return false;
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return false;
if (!autocvar_g_nades)
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))
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;
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;
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';
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)
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;
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
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))
{
{
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);
if (!IS_PLAYER(activator))
return;
- if(activator.deadflag != DEAD_NO)
+ if(IS_DEAD(activator))
return;
EXACTTRIGGER_TOUCH;
}
// 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
{ // 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
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
else
other.lastteleporttime = time;
- if (other.deadflag == DEAD_NO)
+ if (!IS_DEAD(other))
animdecide_setaction(other, ANIMACTION_JUMP, true);
}
else
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)
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;
if(!(validate_flags & TFL_TARGETSELECT_PLAYERS))
return -7;
- if (e_target.deadflag != DEAD_NO)
+ if (IS_DEAD(e_target))
return -8;
}
// 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?
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)
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
//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.
if (self.owner.target_select_playerbias < 0)
return 0;
- if (e_target.deadflag != DEAD_NO)
+ if (IS_DEAD(e_target))
return 0;
}
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;
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)
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;
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)))
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);
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)
}
_vehicle.flags |= FL_NOTARGET;
- if(_vehicle.deadflag == DEAD_NO)
+ if(!IS_DEAD(_vehicle))
_vehicle.avelocity = '0 0 0';
_vehicle.tur_head.nodrawtoclient = world;
{
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)
|| (veh.phase >= time)
|| (pl.vehicle_enter_delay >= time)
|| (pl.frozen)
- || (pl.deadflag != DEAD_NO)
+ || (IS_DEAD(pl))
|| (pl.vehicle)
) { return; }
return false;
if((!IS_PLAYER(other))
- || (other.deadflag != DEAD_NO)
+ || (IS_DEAD(other))
|| (other.vehicle)
|| (DIFF_TEAM(other, self))
) { return false; }
vehic = self.vehicle;
setself(vehic);
- if(vehic.deadflag != DEAD_NO)
+ if(IS_DEAD(vehic))
{
setself(pilot);
pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = 0;
}
else
{
- if(trace_ent.deadflag == DEAD_NO)
+ if(!IS_DEAD(trace_ent))
if((teamplay && trace_ent.team == pilot.team) || !teamplay)
{
self.touch = vehicles_touch;
- if(self.deadflag == DEAD_NO)
+ if(!IS_DEAD(self))
{
self.think = bumblebee_land;
self.nextthink = time;
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;
self.nextthink = time;
- if (self.owner.deadflag != DEAD_NO || self.cnt < time)
+ if (IS_DEAD(self.owner) || self.cnt < time)
{
self.use();
return;
self.nextthink = time;
- if(self.owner.deadflag != DEAD_NO || self.cnt < time)
+ if(IS_DEAD(self.owner) || self.cnt < time)
{
self.use();
return;
vector spot;
self.tur_head.exteriormodeltoclient = world;
- if(self.deadflag == DEAD_NO)
+ if(!IS_DEAD(self))
{
self.think = raptor_land;
self.nextthink = time;
}
*/
- if(raptor.deadflag != DEAD_NO)
+ if(IS_DEAD(raptor))
{
setself(player);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
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();
}
UpdateCSQCProjectile(self);
- if (self.owner.deadflag != DEAD_NO || self.cnt < time)
+ if (IS_DEAD(self.owner) || self.cnt < time)
self.use();
}
||
(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 )
||
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;
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);
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)
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)
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);
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);
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
// 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;
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)
{
// 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();
}
return;
}
- if(other && IS_PLAYER(other) && other.deadflag == DEAD_NO)
+ if(other && IS_PLAYER(other) && !IS_DEAD(other))
{
// hit a player
// don't stick
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);
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);
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);
);
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)
}
///////////////
- if(self.enemy.deadflag != DEAD_NO)
+ if(IS_DEAD(self.enemy))
{
self.enemy = world;
self.cnt = time + 1 + (random() * 4);
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)
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;
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)
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);
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;
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;
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);
// 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))
{
bot_strategytoken_taken = true;
}
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
havocbot_chooseenemy();
{
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 )
// go to best items
void havocbot_role_generic()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if (self.bot_strategytime < time)
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);
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;
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");
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
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)
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();
}
void ShowRespawnCountdown()
{SELFPARAM();
float number;
- if(self.deadflag == DEAD_NO) // just respawned?
+ if(!IS_DEAD(self)) // just respawned?
return;
else
{
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;
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)
{
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);
player_powerups();
}
- if (self.deadflag != DEAD_NO)
+ if (IS_DEAD(self))
{
if(self.personal && g_race_qualifying)
{
void DrownPlayer(entity this)
{
- if(this.deadflag != DEAD_NO)
+ if(IS_DEAD(this))
return;
if (this.waterlevel != WATERLEVEL_SUBMERGED)
#define X(slot) \
IMPULSE(weapon_group_##slot) \
{ \
- if (this.deadflag != DEAD_NO) return; \
+ if (IS_DEAD(this)) return; \
W_NextWeaponOnImpulse(slot); \
}
X(1)
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; \
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)
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;
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);
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");
}
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; }
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;
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))
{
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
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;
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);
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);
void havocbot_ast_reset_role(entity bot)
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if(bot.team == assault_attacker_team)
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(
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;
{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;
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;
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))
}
return;
}
- else if(toucher.deadflag != DEAD_NO) { return; }
+ else if(IS_DEAD(toucher)) { return; }
switch(flag.ctf_status)
{
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);
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)
entity mf, ef;
float c;
- if(bot.deadflag != DEAD_NO)
+ if(IS_DEAD(bot))
return;
if(vlen(havocbot_ctf_middlepoint)==0)
void havocbot_role_ctf_carrier()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
{
havocbot_ctf_reset_role(self);
return;
{SELFPARAM();
entity mf, ef;
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
{
havocbot_ctf_reset_role(self);
return;
entity mf, ef;
vector pos;
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
{
havocbot_ctf_reset_role(self);
return;
{SELFPARAM();
entity mf;
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
{
havocbot_ctf_reset_role(self);
return;
{SELFPARAM();
entity mf;
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
{
havocbot_ctf_reset_role(self);
return;
{SELFPARAM();
entity mf;
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
{
havocbot_ctf_reset_role(self);
return;
// 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)
{
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)
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)
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)
{
.float race_checkpoint;
void havocbot_role_cts()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
entity e;
//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)
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;
}
void havocbot_role_ft_offense()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if (!self.havocbot_role_timeout)
void havocbot_role_ft_freeing()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if (!self.havocbot_role_timeout)
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))
{
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
void havocbot_role_ka_carrier()
{SELFPARAM();
- if (self.deadflag != DEAD_NO)
+ if (IS_DEAD(self))
return;
if (time > self.bot_strategytime)
void havocbot_role_ka_collector()
{SELFPARAM();
- if (self.deadflag != DEAD_NO)
+ if (IS_DEAD(self))
return;
if (time > self.bot_strategytime)
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)
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;
));
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)
void havocbot_role_kh_carrier()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if (!(self.kh_next))
void havocbot_role_kh_defense()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if (self.kh_next)
void havocbot_role_kh_offense()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if (self.kh_next)
void havocbot_role_kh_freelancer()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
if (self.kh_next)
MUTATOR_HOOKFUNCTION(kh, HavocBot_ChooseRole)
{
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return true;
float r = random() * 3;
.float race_checkpoint;
void havocbot_role_race()
{SELFPARAM();
- if(self.deadflag != DEAD_NO)
+ if(IS_DEAD(self))
return;
entity e;
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()
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');
}
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');
}
}
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);
}
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;
remove(this);
return;
}
- if (this.owner.deadflag != DEAD_NO)
+ if (IS_DEAD(self.owner))
{
// owner died; disappear
this.model = "";
remove(this);
return;
}
- if (this.owner.deadflag != DEAD_NO)
+ if (IS_DEAD(self.owner))
{
this.model = "";
return;