diff --git a/code/modules/capture_the_flag/ctf_game.dm b/code/modules/capture_the_flag/ctf_game.dm index 81d0b282c98..6dbe4a74f16 100644 --- a/code/modules/capture_the_flag/ctf_game.dm +++ b/code/modules/capture_the_flag/ctf_game.dm @@ -231,9 +231,17 @@ var/static/list/people_who_want_to_play = list() var/game_area = /area/ctf + /// This variable is needed because of ctf shitcode + we need to make sure we're deleting the current ctf landmark that spawned us in and not a new one. + var/obj/effect/landmark/ctf/ctf_landmark + /obj/machinery/capture_the_flag/Initialize() . = ..() AddElement(/datum/element/point_of_interest) + ctf_landmark = GLOB.ctf_spawner + +/obj/machinery/capture_the_flag/Destroy() + ctf_landmark = null + return ..() /obj/machinery/capture_the_flag/process(delta_time) for(var/i in spawned_mobs) @@ -453,7 +461,11 @@ notify_ghosts("[name] has been activated!", source = src, action=NOTIFY_ORBIT, header = "CTF has been activated") /obj/machinery/capture_the_flag/proc/reset_the_arena() - new /obj/effect/landmark/ctf(get_turf(GLOB.ctf_spawner)) + if(!ctf_landmark) + return + + if(ctf_landmark == GLOB.ctf_spawner) + new /obj/effect/landmark/ctf(get_turf(GLOB.ctf_spawner)) /obj/machinery/capture_the_flag/proc/stop_ctf() diff --git a/code/modules/capture_the_flag/medieval_sim/medisim_game.dm b/code/modules/capture_the_flag/medieval_sim/medisim_game.dm index 8b9215dd8b6..e2dcc0cd445 100644 --- a/code/modules/capture_the_flag/medieval_sim/medisim_game.dm +++ b/code/modules/capture_the_flag/medieval_sim/medisim_game.dm @@ -18,6 +18,10 @@ . = ..() toggle_id_ctf(null, game_id, automated = TRUE)//only one machine runs the victory proc, start_ctf proc would break the other machine +// We don't clean up for the medisim. +/obj/machinery/capture_the_flag/medisim/reset_the_arena() + return + /obj/machinery/capture_the_flag/medisim/spawn_team_member(client/new_team_member) . = ..() if(!.)