From: Mario Date: Thu, 2 Apr 2020 03:32:39 +0000 (+1000) Subject: Clear player waypoint sprites when resetting the flag while speedrunning X-Git-Tag: xonotic-v0.8.5~1134 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7ff0571096c4be4b74a9aeb3f7fa08a08ce1942c;p=xonotic%2Fxonotic-data.pk3dir.git Clear player waypoint sprites when resetting the flag while speedrunning --- diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index 11bbaea6f..cfe8d4058 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -438,7 +438,19 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype) if(!flag) { return; } if((droptype == DROP_PASS) && !receiver) { return; } - if(flag.speedrunning) { ctf_RespawnFlag(flag); return; } + if(flag.speedrunning) + { + // ensure old waypoints are removed before resetting the flag + WaypointSprite_Kill(player.wps_flagcarrier); + + if(player.wps_enemyflagcarrier) + WaypointSprite_Kill(player.wps_enemyflagcarrier); + + if(player.wps_flagreturn) + WaypointSprite_Kill(player.wps_flagreturn); + ctf_RespawnFlag(flag); + return; + } // reset the flag setattachment(flag, NULL, "");