diff --git a/code/__DEFINES/gamemode.dm b/code/__DEFINES/gamemode.dm index 4a45b3e6a65..42835d43813 100644 --- a/code/__DEFINES/gamemode.dm +++ b/code/__DEFINES/gamemode.dm @@ -3,6 +3,7 @@ #define TARGET_INVALID_NOT_HUMAN 2 #define TARGET_INVALID_DEAD 3 #define TARGET_INVALID_NOCKEY 4 +#define TARGET_INVALID_UNREACHABLE 5 //gamemode istype helpers #define GAMEMODE_IS_BLOB (ticker && istype(ticker.mode, /datum/game_mode/blob)) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index a50d3efac6a..aa19a52fa42 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -31,6 +31,10 @@ var/list/potential_theft_objectives = subtypesof(/datum/theft_objective) - /datu return TARGET_INVALID_DEAD if(!possible_target.key) return TARGET_INVALID_NOCKEY + if(possible_target.current) + var/turf/current_location = get_turf(possible_target.current) + if(current_location && !is_level_reachable(current_location.z)) + return TARGET_INVALID_UNREACHABLE /datum/objective/proc/find_target() var/list/possible_targets = list()