From 4d0fb41d8683e0dd06204ef0dfd18ca2362052b7 Mon Sep 17 00:00:00 2001 From: Rhials Date: Fri, 24 Jun 2022 02:35:57 -0400 Subject: [PATCH] Fixes supermatter cascade final objective rolling when the engine has already exploded (#67665) Adds a check so that if there are no var/obj/machinery/power/supermatter_crystal/engine on the station. Testing was a bit hard because I didn't know how to test any of it with admin tools, so it involved a lot of running around doing objectives on local until I got a final objective. I'm pretty sure this PR works correctly. --- .../traitor/objectives/final_objective/final_objective.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm b/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm index 1a58aa86aac..904397813b3 100644 --- a/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm +++ b/code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm @@ -20,6 +20,12 @@ return FALSE if(SStraitor.get_taken_count(type) > 0) // Prevents multiple people from ever getting the same final objective. return FALSE + var/valid_crystal = FALSE + for(var/obj/machinery/power/supermatter_crystal/engine/crystal in GLOB.machines) + if(is_station_level(crystal.z) || is_mining_level(crystal.z)) + valid_crystal = TRUE + if(!valid_crystal) + return FALSE return TRUE /datum/traitor_objective/final/on_objective_taken(mob/user)