SERVER: Prevent multiple uses from trigger_awardpoints

This commit is contained in:
MotoLegacy 2024-01-30 16:55:12 -05:00
parent 60383b1ab0
commit 26b8b610f0

View file

@ -374,7 +374,7 @@ void() trigger_setfire =
void() trigger_awardpoints_touch = void() trigger_awardpoints_touch =
{ {
if (other.classname != "player" || other.downed) if (other.classname != "player" || other.downed || !self.health)
return; return;
if (other.stance != PLAYER_STANCE_STAND && (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_REQUIRESTAND)) if (other.stance != PLAYER_STANCE_STAND && (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_REQUIRESTAND))
@ -388,12 +388,15 @@ void() trigger_awardpoints_touch =
if (self.noise != "") if (self.noise != "")
sound(self, 0, self.noise, 1, 1); sound(self, 0, self.noise, 1, 1);
self.health = 0;
} }
void() trigger_awardpoints = void() trigger_awardpoints =
{ {
InitTrigger (); InitTrigger ();
self.touch = trigger_awardpoints_touch; self.touch = trigger_awardpoints_touch;
self.health = 1;
if (self.noise != "") if (self.noise != "")
precache_sound(self.noise); precache_sound(self.noise);