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 11bbaea..cfe8d40 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, "");