From cd629f1ef1171e44972378f9140698b98783f988 Mon Sep 17 00:00:00 2001 From: div0 Date: Fri, 24 Oct 2008 07:48:04 +0000 Subject: [PATCH] change "player" checks to "iscreature" checks so one can have e.g. crates that push buttons git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4855 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/g_triggers.qc | 25 ++++++++++++++----------- data/qcsrc/server/t_halflife.qc | 2 +- data/qcsrc/server/t_jumppads.qc | 10 +++++----- data/qcsrc/server/t_plats.qc | 10 +++++----- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/data/qcsrc/server/g_triggers.qc b/data/qcsrc/server/g_triggers.qc index 53cd4adf4..03ffc84b0 100644 --- a/data/qcsrc/server/g_triggers.qc +++ b/data/qcsrc/server/g_triggers.qc @@ -54,9 +54,12 @@ void SUB_UseTargets() // if (activator.classname == "player" && self.message != "") { - centerprint (activator, self.message); - if (!self.noise) - play2(activator, "misc/talk.wav"); + if(clienttype(activator) == CLIENTTYPE_REAL) + { + centerprint (activator, self.message); + if (!self.noise) + play2(activator, "misc/talk.wav"); + } } // @@ -174,7 +177,7 @@ void multi_touch() { if not(self.spawnflags & 2) { - if (other.classname != "player") + if not(other.iscreature) return; if(self.team) @@ -762,7 +765,7 @@ void misc_laser_think() if(self.enemy.target != "") // DETECTOR laser { traceline(self.origin, o, MOVE_NORMAL, self); - if(trace_ent.classname == "player") + if(trace_ent.iscreature) { self.pusher = trace_ent; if(!self.count) @@ -915,7 +918,7 @@ void trigger_impulse_touch1() float str; // FIXME: Better checking for what to push and not. - if (other.classname != "player") + if not(other.iscreature) if (other.classname != "corpse") if (other.classname != "body") if (other.classname != "gib") @@ -929,7 +932,7 @@ void trigger_impulse_touch1() if (other.classname != "droppedweapon") return; - if (other.deadflag && other.classname == "player") + if (other.deadflag && other.iscreature) return; EXACTTRIGGER_TOUCH; @@ -963,7 +966,7 @@ void trigger_impulse_touch2() float pushdeltatime; // FIXME: Better checking for what to push and not. - if (other.classname != "player") + if not(other.iscreature) if (other.classname != "corpse") if (other.classname != "body") if (other.classname != "gib") @@ -977,7 +980,7 @@ void trigger_impulse_touch2() if (other.classname != "droppedweapon") return; - if (other.deadflag && other.classname == "player") + if (other.deadflag && other.iscreature) return; EXACTTRIGGER_TOUCH; @@ -1000,7 +1003,7 @@ void trigger_impulse_touch3() float str; // FIXME: Better checking for what to push and not. - if (other.classname != "player") + if not(other.iscreature) if (other.classname != "corpse") if (other.classname != "body") if (other.classname != "gib") @@ -1014,7 +1017,7 @@ void trigger_impulse_touch3() if (other.classname != "droppedweapon") return; - if (other.deadflag && other.classname == "player") + if (other.deadflag && other.iscreature) return; EXACTTRIGGER_TOUCH; diff --git a/data/qcsrc/server/t_halflife.qc b/data/qcsrc/server/t_halflife.qc index 59e04a356..fb03e55e3 100644 --- a/data/qcsrc/server/t_halflife.qc +++ b/data/qcsrc/server/t_halflife.qc @@ -37,7 +37,7 @@ void spawnfunc_func_healthcharger() {}; void func_ladder_touch() { - if (other.classname != "player") + if not(other.iscreature) return; EXACTTRIGGER_TOUCH; diff --git a/data/qcsrc/server/t_jumppads.qc b/data/qcsrc/server/t_jumppads.qc index 66fe2042e..fb0530698 100644 --- a/data/qcsrc/server/t_jumppads.qc +++ b/data/qcsrc/server/t_jumppads.qc @@ -104,7 +104,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) void trigger_push_touch() { // FIXME: add a .float for whether an entity should be tossed by jumppads - if (other.classname != "player") + if (!other.iscreature) if (other.classname != "corpse") if (other.classname != "body") if (other.classname != "gib") @@ -118,7 +118,7 @@ void trigger_push_touch() if (other.classname != "droppedweapon") return; - if (other.deadflag && other.classname == "player") + if (other.deadflag && other.iscreature) return; EXACTTRIGGER_TOUCH; @@ -152,12 +152,12 @@ void trigger_push_touch() other.(jumppadsused[mod(other.jumppadcount, NUM_JUMPPADSUSED)]) = self; other.jumppadcount = other.jumppadcount + 1; } + + if(self.message) + centerprint(other, self.message); } else other.jumppadcount = TRUE; - - if(self.message) - centerprint(other, self.message); } if(self.enemy.target) diff --git a/data/qcsrc/server/t_plats.qc b/data/qcsrc/server/t_plats.qc index 5ce839e56..44a558a9e 100644 --- a/data/qcsrc/server/t_plats.qc +++ b/data/qcsrc/server/t_plats.qc @@ -77,7 +77,7 @@ void plat_go_up() void plat_center_touch() { - if (other.classname != "player") + if not(other.iscreature) return; if (other.health <= 0) @@ -92,7 +92,7 @@ void plat_center_touch() void plat_outside_touch() { - if (other.classname != "player") + if not(other.iscreature) return; if (other.health <= 0) @@ -505,7 +505,7 @@ void button_touch() // } if (!other) return; - if (other.classname != "player") + if not(other.iscreature) return; if(other.velocity * self.movedir < 0) return; @@ -809,7 +809,7 @@ Prints messages */ void door_touch() { - if (other.classname != "player") + if not(other.iscreature) return; if (self.owner.attack_finished_single > time) return; @@ -1207,7 +1207,7 @@ Prints messages */ void secret_touch() { - if (activator.classname != "player") + if not(other.iscreature) return; if (self.attack_finished_single > time) return; -- 2.39.2