From: Samual Date: Sat, 31 Mar 2012 19:47:34 +0000 (-0400) Subject: Enable droppedcapture code to actually work X-Git-Tag: xonotic-v0.7.0~240^2~138 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=48f5291087f01cdc7a078f789aaa815cea1354eb;p=xonotic%2Fxonotic-data.pk3dir.git Enable droppedcapture code to actually work --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 707b205ba..3d79134e8 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -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); } diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index 9818eda1b..09a05a75c 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -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