From ec76c768cd51680b87ea227b11ba18eda6d97a1b Mon Sep 17 00:00:00 2001 From: cypress Date: Sat, 16 Dec 2023 16:51:42 -0500 Subject: [PATCH] SERVER: Add trigger_atroundend, add spawnflags for trigger_hurt --- source/server/entities/triggers.qc | 14 +++++++++++++- source/server/rounds.qc | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/source/server/entities/triggers.qc b/source/server/entities/triggers.qc index 8d09119..c39271b 100644 --- a/source/server/entities/triggers.qc +++ b/source/server/entities/triggers.qc @@ -356,10 +356,21 @@ void() trigger_once = trigger_multiple(); } +void() trigger_atroundend = +{ + self.classname = "trigger_atroundend"; + //self.use = multi_use; +} + // // Quake Triggers // +// NZ:P START -- Spawnflags for not hurting clients and not hurting AI +#define HURT_SPAWNFLAG_NOAI 1 +#define HURT_SPAWNFLAG_NOCLIENT 2 +// NZ:P END + void() hurt_on = { self.solid = SOLID_TRIGGER; @@ -368,7 +379,8 @@ void() hurt_on = void() hurt_touch = { - //if (other.takedamage) + if ((other.classname == "player" && !(self.spawnflags & HURT_SPAWNFLAG_NOCLIENT)) || + (other.aistatus == "1" && !(self.spawnflags & HURT_SPAWNFLAG_NOAI))) { self.solid = SOLID_NOT; DamageHandler(other, self, self.dmg, S_ZOMBIE); diff --git a/source/server/rounds.qc b/source/server/rounds.qc index 3fcddbd..df3ef6f 100644 --- a/source/server/rounds.qc +++ b/source/server/rounds.qc @@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA */ - +void() SUB_UseTargets; float() spawn_a_dogA; void() zapper_cooldown; @@ -165,6 +165,18 @@ void() EndRound = players = find(players, classname, "player"); } } + + // Fire off all trigger_atroundent ents + entity triggers = find(world, classname, "trigger_atroundend"); + while(triggers != world) { + if (triggers.health == rounds) { + entity oldself = self; + self = triggers; + SUB_UseTargets(); + self = oldself; + } + triggers = find(triggers, classname, "trigger_atroundend"); + } } void() NewRound =