Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions code/game/gamemodes/objective.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)

/datum/objective/break_machinery/finalize()
target_areas = list()
var/station_z = SSmapping.levels_by_trait(ZTRAIT_STATION)[1]
var/list/station_zs = SSmapping.levels_by_trait(ZTRAIT_STATION)
if(!target_obj_type) // Select our target machine if there is none pre-set
potential_target_types = list(
// SCIENCE
Expand All @@ -1597,7 +1597,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
var/iteration = 1
while(!target_obj_type && targets_len >= iteration)
for(var/obj/machinery/machine as anything in GLOB.machines)
if(machine.z == station_z && istype(machine, potential_target_types[iteration]))
if((machine.z in station_zs) && istype(machine, potential_target_types[iteration]) && (get_area(machine) in GLOB.the_station_areas))
target_obj_type = potential_target_types[iteration]
break
iteration++
Expand All @@ -1612,12 +1612,10 @@ GLOBAL_LIST_EMPTY(possible_items_special)
for(var/obj/machinery/machine as anything in GLOB.machines)
if(!istype(machine, target_obj_type))
continue
if(machine.z != station_z)
if(!(machine.z in station_zs))
continue
if(!istype(get_area(machine), /area))
if(!(get_area(machine) in GLOB.the_station_areas))
continue
if(istype(get_area(machine), /area/shuttle))
continue //no whiteship machines
eligible_machines |= machine

eligible_machines = shuffle(eligible_machines)
Expand Down