void M_Item_Touch ()
{
- if(self && other.classname == STR_PLAYER && other.deadflag == DEAD_NO)
+ if(self && IS_PLAYER(other) && other.deadflag == DEAD_NO)
{
Item_Touch();
self.think = SUB_Remove;
if(targ.items & IT_INVISIBILITY)
return FALSE; // enemy is invisible
- if(targ.classname == STR_SPECTATOR || targ.classname == STR_OBSERVER)
+ if(IS_SPEC(targ) || IS_OBSERVER(targ))
return FALSE; // enemy is a spectator
if(targ.deadflag != DEAD_NO || ent.deadflag != DEAD_NO || targ.health <= 0 || ent.health <= 0)
if(self.realowner.classname == "monster_spawner")
self.realowner.spawner_monstercount -= 1;
- if(self.realowner.flags & FL_CLIENT)
+ if(IS_CLIENT(self.realowner))
self.realowner.monstercount -= 1;
totalspawned -= 1;
if(self.netname == "")
{
- if(net_name != "" && self.realowner.classname == STR_PLAYER)
+ if(net_name != "" && IS_PLAYER(self.realowner))
net_name = strzone(strdecolorize(sprintf("%s's %s", self.realowner.netname, net_name)));
self.netname = ((net_name == "") ? self.classname : net_name);
}
{
if not(autocvar_g_monsters)
{
- if(spawnedby.flags & FL_CLIENT)
+ if(IS_CLIENT(spawnedby))
Send_Notification(NOTIF_ONE, spawnedby, MSG_INFO, INFO_MONSTERS_DISABLED);
return world;
if (spawnedby.classname == "monster_swarm")
e.monster_owner = own;
- else if(spawnedby.flags & FL_CLIENT)
+ else if(IS_CLIENT(spawnedby))
{
if(teamplay && autocvar_g_monsters_teams)
e.team = spawnedby.team; // colors handled in spawn code
void td_generator_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if(attacker.classname == STR_PLAYER || attacker.turrcaps_flags & TFL_TURRCAPS_ISTURRET || attacker.vehicle_flags & VHF_ISVEHICLE)
+ if(IS_PLAYER(attacker) || attacker.turrcaps_flags & TFL_TURRCAPS_ISTURRET || attacker.vehicle_flags & VHF_ISVEHICLE)
return;
Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TD_GENDAMAGED);
void spawnturret(entity spawnedby, entity own, string turet, vector orig)
{
- if(spawnedby.classname != STR_PLAYER)
+ if(!IS_PLAYER(spawnedby))
{
dprint("Warning: A non-player entity tried to spawn a turret\n");
return;
if(frag_attacker.vehicle_flags & VHF_ISVEHICLE && !(frag_target.flags & FL_MONSTER))
frag_damage = 0;
- if(!autocvar_g_td_pvp && frag_attacker != frag_target && frag_target.classname == STR_PLAYER && frag_attacker.classname == STR_PLAYER)
+ if(!autocvar_g_td_pvp && frag_attacker != frag_target && IS_PLAYER(frag_target) && IS_PLAYER(frag_attacker))
frag_damage = 0;
- if(frag_attacker.turrcaps_flags & TFL_TURRCAPS_ISTURRET && frag_target.classname == STR_PLAYER)
+ if(frag_attacker.turrcaps_flags & TFL_TURRCAPS_ISTURRET && IS_PLAYER(frag_target))
frag_damage = 0;
if((frag_target.turrcaps_flags & TFL_TURRCAPS_ISTURRET) && !(frag_attacker.flags & FL_MONSTER || frag_attacker.turrcaps_flags & TFL_TURRCAPS_SUPPORT))
current_monsters -= 1;
monsters_killed += 1;
- if(frag_attacker.classname == STR_PLAYER)
+ if(IS_PLAYER(frag_attacker))
{
PlayerScore_Add(frag_attacker, SP_TD_SCORE, autocvar_g_td_kill_points);
PlayerScore_Add(frag_attacker, SP_TD_KILLS, 1);
}
- else if(frag_attacker.realowner.classname == STR_PLAYER)
+ else if(IS_PLAYER(frag_attacker.realowner))
{
PlayerScore_Add(frag_attacker.realowner, SP_TD_SCORE, autocvar_g_td_turretkill_points);
PlayerScore_Add(frag_attacker.realowner, SP_TD_TURKILLS, 1);
Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TD_LIST, "mlrs walker plasma towerbuff flac barricade");
return TRUE;
}
- if(self.classname != STR_PLAYER || self.health <= 0)
+ if(!IS_PLAYER(self) || self.health <= 0)
{
Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TD_CANTSPAWN);
return TRUE;