From 8d72b72b609369b8a4f9d9dc8ae022266f4ba883 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 30 Jun 2011 11:51:41 +0200 Subject: [PATCH] we don't use "corpse" and "gib" classnames anywhere --- qcsrc/server/cl_player.qc | 4 ++-- qcsrc/server/g_damage.qc | 10 +++------- qcsrc/server/g_triggers.qc | 40 +++----------------------------------- qcsrc/server/nexball.qc | 2 +- qcsrc/server/t_jumppads.qc | 17 +--------------- 5 files changed, 10 insertions(+), 63 deletions(-) diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index dc5c0addc..cd846b15b 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -530,7 +530,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // escape a lava pit or similar //self.pushltime = 0; } - else if(attacker.classname == "player" || attacker.classname == "gib") + else if(attacker.classname == "player") { self.pusher = attacker; self.pushltime = time + autocvar_g_maxpushtime; @@ -643,7 +643,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht if(self.flagcarried) { - if(attacker.classname != "player" && attacker.classname != "gib") + if(attacker.classname != "player") DropFlag(self.flagcarried, self, attacker); // penalty for flag loss by suicide else if(attacker.team == self.team) DropFlag(self.flagcarried, attacker, attacker); // penalty for flag loss by suicide/teamkill diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 98bf87f5a..9eaf82dc4 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -299,13 +299,9 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) string s, a, msg; float w, type; - if (targ.classname == "player" || targ.classname == "corpse") + if (targ.classname == "player") { - if (targ.classname == "corpse") - s = "A corpse"; - else - s = targ.netname; - + s = targ.netname; a = attacker.netname; if (targ == attacker) // suicides @@ -333,7 +329,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) Send_KillNotification(s, msg, ftos(w), deathtype, MSG_SUICIDE); } - else if (attacker.classname == "player" || attacker.classname == "gib") + else if (attacker.classname == "player") { if(teamplay && attacker.team == targ.team) { diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 98adee0c1..1f3c7f548 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -1377,7 +1377,7 @@ void trigger_impulse_touch1() if (self.active != ACTIVE_ACTIVE) return; - if(!isPushable(other)) + if (!isPushable(other)) return; EXACTTRIGGER_TOUCH; @@ -1415,24 +1415,7 @@ void trigger_impulse_touch2() if (self.active != ACTIVE_ACTIVE) return; - // FIXME: Better checking for what to push and not. - if not(other.iscreature) - if (other.classname != "corpse") - if (other.classname != "body") - if (other.classname != "gib") - if (other.classname != "missile") - if (other.classname != "rocket") - if (other.classname != "casing") - if (other.classname != "grenade") - if (other.classname != "plasma") - if (other.classname != "plasma_prim") - if (other.classname != "plasma_chain") - if (other.classname != "droppedweapon") - if (other.classname != "nexball_basketball") - if (other.classname != "nexball_football") - return; - - if (other.deadflag && other.iscreature) + if (!isPushable(other)) return; EXACTTRIGGER_TOUCH; @@ -1456,24 +1439,7 @@ void trigger_impulse_touch3() if (self.active != ACTIVE_ACTIVE) return; - // FIXME: Better checking for what to push and not. - if not(other.iscreature) - if (other.classname != "corpse") - if (other.classname != "body") - if (other.classname != "gib") - if (other.classname != "missile") - if (other.classname != "rocket") - if (other.classname != "casing") - if (other.classname != "grenade") - if (other.classname != "plasma") - if (other.classname != "plasma_prim") - if (other.classname != "plasma_chain") - if (other.classname != "droppedweapon") - if (other.classname != "nexball_basketball") - if (other.classname != "nexball_football") - return; - - if (other.deadflag && other.iscreature) + if (!isPushable(other)) return; EXACTTRIGGER_TOUCH; diff --git a/qcsrc/server/nexball.qc b/qcsrc/server/nexball.qc index 1cfbbe7b7..b43333bcd 100644 --- a/qcsrc/server/nexball.qc +++ b/qcsrc/server/nexball.qc @@ -597,7 +597,7 @@ void W_Nexball_Touch (void) PROJECTILE_TOUCH; if(attacker.team != other.team || g_nexball_basketball_teamsteal) - if((ball = other.ballcarried) && (attacker.classname == "player" || attacker.classname == "gib")) + if((ball = other.ballcarried) && (attacker.classname == "player")) { other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force; other.flags &~= FL_ONGROUND; diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index a61c6a79d..8da124971 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -130,22 +130,7 @@ void trigger_push_touch() if (self.active == ACTIVE_NOT) return; - if not(other.iscreature) - if (other.classname != "body") - if (other.classname != "casing") - if (other.classname != "corpse") - if (other.classname != "droppedweapon") - if (other.classname != "gib") - if (other.classname != "keepawayball") - if (other.classname != "nexball_basketball") - if (other.classname != "nexball_football") - if (!other.projectiledeathtype || other.classname == "bullet") - return; - - if(!isPushable(other)) - return; - - if (other.deadflag && other.iscreature) + if (!isPushable(other)) return; if(self.team) -- 2.39.2