]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Enable droppedcapture code to actually work
authorSamual <samual@xonotic.org>
Sat, 31 Mar 2012 19:47:34 +0000 (15:47 -0400)
committerSamual <samual@xonotic.org>
Sat, 31 Mar 2012 19:47:34 +0000 (15:47 -0400)
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_ctf.qh

index 707b205ba40ef8eeb7c3eb49ec5c70aeb8a627c6..3d79134e8402553f298c5de3ce3e8c6c69544a67 100644 (file)
@@ -240,17 +240,18 @@ void ctf_Handle_Drop(entity player, float droptype)
 
 void ctf_Handle_Dropped_Capture(entity flag, entity enemy_flag)
 {
-       /*
        // declarations
        float cap_time, cap_record, success;
        string cap_message, refername;
        
        entity player = enemy_flag.ctf_dropper;
+       
+       if not(player) { return; } // without someone to give the reward to, we can't possibly cap
 
        // records
        if((autocvar_g_ctf_captimerecord_always) || (player_count - currentbots)) {
                cap_record = ctf_captimerecord;
-               cap_time = (time - player.flagcarried.ctf_pickuptime);
+               cap_time = (time - enemy_flag.ctf_pickuptime);
 
                refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
                refername = ((refername == player.netname) ? "their" : strcat(refername, "^7's"));
@@ -269,9 +270,9 @@ void ctf_Handle_Dropped_Capture(entity flag, entity enemy_flag)
                        write_recordmarker(player, (time - cap_time), cap_time); } }
        
        // messages and sounds
-       Send_KillNotification(player.netname, player.flagcarried.netname, cap_message, INFO_CAPTUREFLAG, MSG_INFO);
+       Send_KillNotification(player.netname, enemy_flag.netname, cap_message, INFO_CAPTUREFLAG, MSG_INFO);
        sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTN_NONE); // "ctf/*_capture.wav"
-       ctf_EventLog("capture", player.flagcarried.team, player);
+       ctf_EventLog("droppedcapture", enemy_flag.team, player);
        
        // scoring
        PlayerTeamScore_AddScore(player, ctf_ReadScore("score_capture"));
@@ -283,18 +284,8 @@ void ctf_Handle_Dropped_Capture(entity flag, entity enemy_flag)
                pointparticles(particleeffectnum((player.team == COLOR_TEAM1) ? "red_ground_quake" : "blue_ground_quake"), flag.origin, '0 0 0', 1);
                //shockwave_spawn("models/ctf/shockwavetransring.md3", flag.origin - '0 0 15', -0.8, 0, 1);
        }
-
-       // waypointsprites
-       WaypointSprite_Kill(player.wps_flagcarrier);
-
-       // reset the flag
-       if(flag.speedrunning) { ctf_FakeTimeLimit(player, -1); }
-       
-       */
-       
-       sound(flag, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTN_NONE);
-       print("dropped capture! :D\n");
        
+       // reset the flag
        ctf_RespawnFlag(enemy_flag);
 }
 
index 9818eda1b4af63fc304f63342aeffdf4b5610a27..09a05a75c9dc20967df42c3bedcb56a8bd1791ac 100644 (file)
@@ -18,7 +18,7 @@ void spawnfunc_item_flag_team1();
 void spawnfunc_item_flag_team2();
 void spawnfunc_ctf_team();
 
-// flag constants 
+// flag constants // for most of these, there is just one question to be asked: WHYYYYY?
 #define FLAG_MIN (PL_MIN + '0 0 -13')
 #define FLAG_MAX (PL_MAX + '0 0 -13')
 #define FLAG_SCALE 0.6