From 83edfbc033c70430b6f23879165050450700f840 Mon Sep 17 00:00:00 2001 From: Finny Merrill Date: Sun, 25 Jan 2004 09:04:50 +0000 Subject: [PATCH] Fixing spy-related bugs, 1) invis only being set on first connect on first map, dur 2) double- or triple-remove in regeneratecells (shaka, I want to smack you). --- client.qc | 14 ++++++++++++-- tfort.qc | 14 +++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/client.qc b/client.qc index 9de8bc6..58908ec 100644 --- a/client.qc +++ b/client.qc @@ -460,6 +460,9 @@ void() DecodeLevelParms = allow_hook = 0; invis_only = SPY_INVIS_ONLY; + sprint (self, PRINT_HIGH, "check1, SPY_INVIS_ONLY? " + ftos (SPY_INVIS_ONLY) + " invis_only? " + + ftos (invis_only) + "\n"); + if (coop || !deathmatch) toggleflags = toggleflags | TFLAG_CLASS_PERSIST; @@ -474,8 +477,10 @@ void() DecodeLevelParms = if (ent) { // Turn on Teamplay - if (teamplay == 0) + if (teamplay == 0) { cvar_set("teamplay","21?TeamFortress"); + teamplay = 21; + } // Parse the rest of the Detection details ParseTFDetect(ent); @@ -495,8 +500,10 @@ void() DecodeLevelParms = CTF_Map = TRUE; // Turn on Teamplay - if (teamplay == 0) + if (teamplay == 0) { cvar_set("teamplay","21?TeamFortress"); + teamplay = 21; + } // Setup the CTF FlagCheck Timer ent = spawn(); @@ -681,6 +688,9 @@ void() DecodeLevelParms = if (!teamplay) invis_only = TRUE; + sprint (self, PRINT_HIGH, "check2, st? " + st + " teamplay? " + ftos (teamplay) + " invis_only? " + + ftos (invis_only) + "\n"); + // RespawnDelay st = infokey(NIL, "rd"); if (!st) diff --git a/tfort.qc b/tfort.qc index 5e4774a..17f8ebc 100644 --- a/tfort.qc +++ b/tfort.qc @@ -3559,12 +3559,20 @@ void() TeamFortress_RegenerateCells = { //WK Borrow this code from TF, since there's no reason to // duplicate it. - if (!(self.owner.job & JOB_THIEF)) + // Griev - HEY FUCKTARD, REMOVING MORE THAN ONCE IS IDIOTIC! + if (!(self.owner.job & JOB_THIEF)) { dremove(self); - if (!(self.owner.job & JOB_ACTIVE)) + return; + } + if (!(self.owner.job & JOB_ACTIVE)) { dremove(self); - if (self.owner.health <= 0) + return; + } + if (self.owner.health <= 0) { dremove(self); + return; + } + self.nextthink = time + PC_SPY_CELL_REGEN_TIME; if (self.owner.job & JOB_ACTIVE) {