From ad6c866f8f594a154896f2d6700ef6992f44aae4 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 26 Jan 2019 17:15:23 -0800 Subject: [PATCH 1/2] Stops objectives targeting admin centcom characters --- code/__DEFINES/gamemode.dm | 1 + code/game/gamemodes/objective.dm | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/code/__DEFINES/gamemode.dm b/code/__DEFINES/gamemode.dm index 4a45b3e6a65..471ce5a522a 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_ADMINZLEVEL 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..2e7bb1ce1fa 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_admin_level(current_location.z)) + return TARGET_INVALID_ADMINZLEVEL /datum/objective/proc/find_target() var/list/possible_targets = list() From ede521709388ddd532366a9935a55b0b6c78ce24 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 26 Jan 2019 17:23:20 -0800 Subject: [PATCH 2/2] switch to is_level_reachable --- code/__DEFINES/gamemode.dm | 2 +- code/game/gamemodes/objective.dm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/gamemode.dm b/code/__DEFINES/gamemode.dm index 471ce5a522a..42835d43813 100644 --- a/code/__DEFINES/gamemode.dm +++ b/code/__DEFINES/gamemode.dm @@ -3,7 +3,7 @@ #define TARGET_INVALID_NOT_HUMAN 2 #define TARGET_INVALID_DEAD 3 #define TARGET_INVALID_NOCKEY 4 -#define TARGET_INVALID_ADMINZLEVEL 5 +#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 2e7bb1ce1fa..aa19a52fa42 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -33,8 +33,8 @@ var/list/potential_theft_objectives = subtypesof(/datum/theft_objective) - /datu return TARGET_INVALID_NOCKEY if(possible_target.current) var/turf/current_location = get_turf(possible_target.current) - if(current_location && is_admin_level(current_location.z)) - return TARGET_INVALID_ADMINZLEVEL + if(current_location && !is_level_reachable(current_location.z)) + return TARGET_INVALID_UNREACHABLE /datum/objective/proc/find_target() var/list/possible_targets = list()