mirror of
https://github.com/nzp-team/quakec.git
synced 2025-01-19 07:40:51 +00:00
SERVER: Add trigger_atroundend, add spawnflags for trigger_hurt
This commit is contained in:
parent
e26fd61044
commit
ec76c768cd
2 changed files with 26 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue