]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clear player waypoint sprites when resetting the flag while speedrunning
authorMario <mario.mario@y7mail.com>
Thu, 2 Apr 2020 03:32:39 +0000 (13:32 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 2 Apr 2020 03:32:39 +0000 (13:32 +1000)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc

index 11bbaea6fb0af43f62e8c014e98718327f0af364..cfe8d4058d983d42a4ceca3c45e74706b72a99b3 100644 (file)
@@ -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, "");