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.
This commit is contained in:
Rhials
2022-06-24 02:35:57 -04:00
committed by GitHub
parent d47b83c92c
commit 4d0fb41d86
@@ -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)