From 3577fd3bc88b84dba989ed5eb01ef8d65b489864 Mon Sep 17 00:00:00 2001 From: Lucy Date: Thu, 12 Sep 2024 10:25:50 -0400 Subject: [PATCH] werfuijer8yuherfg8yuihwerfg8yui3werfg8yuwerfg8eryufgh8eryugh (#3352) --- code/__HELPERS/~monkestation-helpers/mobs.dm | 10 ++++++++++ code/game/gamemodes/objective.dm | 8 +++++++- .../code/modules/storytellers/gamemode_subsystem.dm | 3 +-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/~monkestation-helpers/mobs.dm b/code/__HELPERS/~monkestation-helpers/mobs.dm index d40f8cfae4ac..7a13f5fbfcd9 100644 --- a/code/__HELPERS/~monkestation-helpers/mobs.dm +++ b/code/__HELPERS/~monkestation-helpers/mobs.dm @@ -19,3 +19,13 @@ var/obj/item/organ/internal/brain/brain = target if(!QDELETED(brain.brainmob?.mind)) return brain.brainmob.mind + +/proc/is_late_arrival(mob/living/player) + var/static/cached_result + if(!isnull(cached_result)) + return cached_result + if(!HAS_TRAIT(SSstation, STATION_TRAIT_LATE_ARRIVALS) || (STATION_TIME_PASSED() > 1 MINUTES)) + return cached_result = FALSE + if(QDELETED(player) || !istype(get_area(player), /area/shuttle/arrival)) + return FALSE + return TRUE diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 169d1ca95319..58570722ec68 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -246,8 +246,14 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list /datum/objective/mutiny/check_completion() - if(!target || !considered_alive(target) || considered_afk(target) || considered_exiled(target)) + // monkestation start: fix bugs with revs ending early due to late arrivals + if(QDELETED(target)) return TRUE + if(is_late_arrival(target.current)) + return FALSE + if(!considered_alive(target) || considered_afk(target) || considered_exiled(target)) + return TRUE + // monkestation end var/turf/T = get_turf(target.current) return !T || !is_station_level(T.z) diff --git a/monkestation/code/modules/storytellers/gamemode_subsystem.dm b/monkestation/code/modules/storytellers/gamemode_subsystem.dm index c0dba7522d87..561149220487 100644 --- a/monkestation/code/modules/storytellers/gamemode_subsystem.dm +++ b/monkestation/code/modules/storytellers/gamemode_subsystem.dm @@ -265,8 +265,7 @@ SUBSYSTEM_DEF(gamemode) continue // I split these checks up to make the code more readable ~Lucy var/is_on_station = is_station_level(player.z) - var/is_late_arrival = HAS_TRAIT(SSstation, STATION_TRAIT_LATE_ARRIVALS) && istype(get_area(player), /area/shuttle/arrival) - if(!is_on_station && !is_late_arrival) + if(!is_on_station && !is_late_arrival(player)) continue candidate_candidates += player