]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Little cleanup/fix the flag think method
authorSamual <samual@xonotic.org>
Fri, 30 Mar 2012 02:58:13 +0000 (22:58 -0400)
committerSamual <samual@xonotic.org>
Fri, 30 Mar 2012 02:58:13 +0000 (22:58 -0400)
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_ctf.qh

index 2d6bcfd39f9d5f2f09565a30841716c7c0ede76c..f674a7ca9f349ff61f51f95b38a988ec2a529726 100644 (file)
@@ -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
index 4d1f003ef1cfb06859d4c47e2483be4d3e4c67cb..4feca2d09a4de9e2827c356f84ec4dbeae2c4110 100644 (file)
@@ -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;