mirror of
https://github.com/nzp-team/quakec.git
synced 2025-01-31 21:50:54 +00:00
SERVER: Add supper for triggerstate; decrement game_counter when triggerstate is OFF
This commit is contained in:
parent
2cc0ca7ed3
commit
b5ecd5dafd
3 changed files with 20 additions and 2 deletions
|
@ -43,7 +43,15 @@
|
|||
|
||||
float cheats_have_been_activated;
|
||||
|
||||
// Quake assumes these are defined.
|
||||
// cypress - NOTE
|
||||
// on/off are inverted compared to goldsrc for
|
||||
// compatibility with existing nzp content.
|
||||
#define TRIGGERSTATE_ON 0
|
||||
#define TRIGGERSTATE_OFF 1
|
||||
#define TRIGGERSTATE_TOGGLE 2
|
||||
|
||||
.float triggerstate;
|
||||
|
||||
string string_null;
|
||||
.string killtarget;
|
||||
entity activator;
|
||||
|
|
|
@ -384,7 +384,10 @@ void() place_model =
|
|||
#define SPAWNFLAG_COUNTER_RESETONFIRE 2
|
||||
void() game_counter_increment =
|
||||
{
|
||||
self.frags++;
|
||||
if (global_triggerstate == TRIGGERSTATE_OFF)
|
||||
self.frags--;
|
||||
else
|
||||
self.frags++;
|
||||
|
||||
if (self.frags == self.health) {
|
||||
SUB_UseTargets();
|
||||
|
|
|
@ -54,6 +54,8 @@ void() DelayThink =
|
|||
remove(self);
|
||||
};
|
||||
|
||||
float global_triggerstate;
|
||||
|
||||
void() SUB_UseTargets =
|
||||
{
|
||||
local entity t, stemp, otemp, act;
|
||||
|
@ -146,6 +148,7 @@ void() SUB_UseTargets =
|
|||
t.enemy = activator;
|
||||
t.message = self.message;
|
||||
t.killtarget = self.killtarget;
|
||||
t.triggerstate = self.triggerstate;
|
||||
t.target = self.target;
|
||||
t.target2 = self.target2;
|
||||
t.target3 = self.target3;
|
||||
|
@ -189,8 +192,12 @@ void() SUB_UseTargets =
|
|||
t.classname = "spawn_dog";
|
||||
if (self.use != SUB_Null)
|
||||
{
|
||||
global_triggerstate = self.triggerstate;
|
||||
|
||||
if (self.use)
|
||||
self.use();
|
||||
|
||||
global_triggerstate = -1;
|
||||
}
|
||||
self = stemp;
|
||||
other = otemp;
|
||||
|
|
Loading…
Reference in a new issue