SERVER: Add trigger_atroundend, add spawnflags for trigger_hurt

This commit is contained in:
cypress 2023-12-16 16:51:42 -05:00
parent e26fd61044
commit ec76c768cd
2 changed files with 26 additions and 2 deletions

View file

@ -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);

View file

@ -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 =