From 35e4aabd0b72a86248ef6613bbd2ea9233e76a3f Mon Sep 17 00:00:00 2001 From: Will <7099514+Willburd@users.noreply.github.com> Date: Sat, 8 Nov 2025 02:55:11 -0500 Subject: [PATCH] Stunned In Object View Decouple fix (#18748) * decouple is safer * disable stun ending object views * ghostize needs to end remote views --- code/datums/components/remote_view.dm | 2 +- code/datums/remote_view_config.dm | 20 ++++++++++++++++++++ code/modules/mob/dead/observer/observer.dm | 1 + code/modules/mob/mob.dm | 4 ++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/code/datums/components/remote_view.dm b/code/datums/components/remote_view.dm index dd065b6a83..d9c78582d4 100644 --- a/code/datums/components/remote_view.dm +++ b/code/datums/components/remote_view.dm @@ -474,7 +474,7 @@ spawn(0) // Decouple the view to the turf on drop, or we'll be stuck on the mob that dropped us forever if(!QDELETED(cache_mob)) - cache_mob.AddComponent(/datum/component/remote_view, release_turf) + cache_mob.AddComponent(/datum/component/remote_view, focused_on = release_turf, vconfig_path = /datum/remote_view_config/turf_decoupling) cache_mob.client.eye = release_turf // Yes-- cache_mob.client.perspective = EYE_PERSPECTIVE // --this is required too. if(!isturf(cache_mob.loc)) // For stuff like paicards diff --git a/code/datums/remote_view_config.dm b/code/datums/remote_view_config.dm index a8bcce6e27..bcee032b9f 100644 --- a/code/datums/remote_view_config.dm +++ b/code/datums/remote_view_config.dm @@ -76,6 +76,26 @@ will_sleep = FALSE will_blind = FALSE +/// Remote view that handles being inside of an object. This ignores stuns and other effects, as you are remaining within the object anyway. +/datum/remote_view_config/inside_object + forbid_movement = TRUE + will_death = TRUE + will_stun = FALSE + will_weaken = FALSE + will_paralyze = FALSE + will_sleep = FALSE + will_blind = FALSE + +/// Remote view that only allows decoupling a turf view by movement. Seperate from effect_immune to allow for easier removal in the future if the underlying issue that makes this needed is someday fixed +/datum/remote_view_config/turf_decoupling + forbid_movement = TRUE + will_death = TRUE + will_stun = FALSE + will_weaken = FALSE + will_paralyze = FALSE + will_sleep = FALSE + will_blind = FALSE + /// Remote view that relays movement to the remote_view_target /datum/remote_view_config/relay_movement relay_movement = TRUE diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index b4f83a7897..c71c042868 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -183,6 +183,7 @@ Works together with spawning an observer, noted above. //RS Port #658 End /mob/proc/ghostize(var/can_reenter_corpse = 1, var/aghost = FALSE) + reset_perspective(src) // End any remoteview we're in if(key) if(ishuman(src)) var/mob/living/carbon/human/H = src diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 7c624924c7..176382fe03 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -306,10 +306,10 @@ if(remote_comp?.looking_at_target_already(loc)) return FALSE if(isitem(loc) || isbelly(loc)) // Requires more careful handling than structures because they are held by mobs - AddComponent(/datum/component/remote_view/mob_holding_item, focused_on = loc, vconfig_path = null) + AddComponent(/datum/component/remote_view/mob_holding_item, focused_on = loc, vconfig_path = /datum/remote_view_config/inside_object) return TRUE if(loc.flags & REMOTEVIEW_ON_ENTER) // Handle atoms that begin a remote view upon entering them. - AddComponent(/datum/component/remote_view, focused_on = loc, vconfig_path = null) + AddComponent(/datum/component/remote_view, focused_on = loc, vconfig_path = /datum/remote_view_config/inside_object) return TRUE return FALSE