From 15370243a6b5eb4acb57b6c319cc21adbbf8fb0e Mon Sep 17 00:00:00 2001 From: Samual Date: Thu, 29 Mar 2012 22:58:13 -0400 Subject: [PATCH] Little cleanup/fix the flag think method --- qcsrc/server/mutators/gamemode_ctf.qc | 13 +++++++------ qcsrc/server/mutators/gamemode_ctf.qh | 15 ++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 2d6bcfd39..f674a7ca9 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -365,7 +365,7 @@ void ctf_FlagThink() // declarations entity tmp_entity; - self.nextthink = time + 0.1; // only 10 fps, more is unnecessary. + self.nextthink = time + 0.2; // only 5 fps, more is unnecessary. // captureshield if(self == ctf_worldflaglist) // only for the first flag @@ -379,10 +379,10 @@ void ctf_FlagThink() if(!trace_startsolid) // can we resize it without getting stuck? setsize(self, FLAG_MIN, FLAG_MAX); } - if(self.owner.classname != "player" || (self.owner.deadflag) || (self.owner.flagcarried != self)) { - dprint("CANNOT HAPPEN - player dead and STILL had a flag!\n"); - ctf_Handle_Drop(self.owner); - return; } + //if(self.owner.classname == "player" || (self.owner.deadflag) || (self.owner.flagcarried != self)) { + // dprint("CANNOT HAPPEN - player dead and STILL had a flag!\n"); + // ctf_Handle_Drop(self.owner); + // return; } // main think method switch(self.ctf_status) @@ -394,7 +394,7 @@ void ctf_FlagThink() if(time > self.ctf_droptime + autocvar_g_ctf_flag_returntime) { bprint("The ", self.netname, " has returned to base\n"); - sound (self, CH_TRIGGER, self.noise3, VOL_BASE, ATTN_NONE); + sound(self, CH_TRIGGER, self.noise3, VOL_BASE, ATTN_NONE); ctf_EventLog("returned", self.team, world); ctf_RespawnFlag(self); } @@ -551,6 +551,7 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag flag.reset = ctf_Reset; flag.touch = ctf_FlagTouch; flag.think = ctf_FlagThink; + flag.nextthink = time + 0.2; flag.ctf_status = FLAG_BASE; // appearence diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index 4d1f003ef..4feca2d09 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -15,21 +15,22 @@ void spawnfunc_ctf_team(); // flag constants #define FLAG_MIN (PL_MIN + '0 0 -13') #define FLAG_MAX (PL_MAX + '0 0 -13') - -#define FLAG_CARRY_OFFSET '-15 0 7' +#define FLAG_CARRY_OFFSET ('-15 0 7') #define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_z - 13)) -#define FLAG_WAYPOINT_OFFSET '0 0 64' +#define FLAG_WAYPOINT_OFFSET ('0 0 64') -#define ctf_spawnorigin dropped_origin +// list of flags on the map +entity ctf_worldflaglist; +.entity ctf_worldflagnext; +// waypoint sprites .entity bot_basewaypoint; // flag waypointsprite .entity wps_flagbase; .entity wps_flagcarrier; .entity wps_flagdropped; -entity ctf_worldflaglist; // CTF flags in the map -.entity ctf_worldflagnext; - +// flag properties +#define ctf_spawnorigin dropped_origin float ctf_captimerecord; // record time for capturing the flag .float ctf_pickuptime; .float ctf_pickupid; -- 2.39.2