mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
[MIRROR] Remote view recursive prey fix (#11853)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
837ea9590d
commit
135c7835f2
@@ -27,7 +27,7 @@
|
|||||||
RegisterSignal(host_mob, COMSIG_MOB_RESET_PERSPECTIVE, PROC_REF(on_reset_perspective))
|
RegisterSignal(host_mob, COMSIG_MOB_RESET_PERSPECTIVE, PROC_REF(on_reset_perspective))
|
||||||
RegisterSignal(host_mob, COMSIG_MOB_LOGOUT, PROC_REF(handle_endview))
|
RegisterSignal(host_mob, COMSIG_MOB_LOGOUT, PROC_REF(handle_endview))
|
||||||
RegisterSignal(host_mob, COMSIG_MOB_DEATH, PROC_REF(handle_endview))
|
RegisterSignal(host_mob, COMSIG_MOB_DEATH, PROC_REF(handle_endview))
|
||||||
RegisterSignal(host_mob, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_endview))
|
RegisterSignal(host_mob, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_forced_endview))
|
||||||
// Recursive move component fires this, we only want it to handle stuff like being inside a paicard when releasing turf lock
|
// Recursive move component fires this, we only want it to handle stuff like being inside a paicard when releasing turf lock
|
||||||
if(isturf(focused_on))
|
if(isturf(focused_on))
|
||||||
RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(handle_recursive_moved))
|
RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(handle_recursive_moved))
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
if(host_mob != remote_view_target) // Some items just offset our view, so we set ourselves as the view target, don't double dip if so!
|
if(host_mob != remote_view_target) // Some items just offset our view, so we set ourselves as the view target, don't double dip if so!
|
||||||
RegisterSignal(remote_view_target, COMSIG_QDELETING, PROC_REF(handle_endview))
|
RegisterSignal(remote_view_target, COMSIG_QDELETING, PROC_REF(handle_endview))
|
||||||
RegisterSignal(remote_view_target, COMSIG_MOB_RESET_PERSPECTIVE, PROC_REF(on_remotetarget_reset_perspective))
|
RegisterSignal(remote_view_target, COMSIG_MOB_RESET_PERSPECTIVE, PROC_REF(on_remotetarget_reset_perspective))
|
||||||
RegisterSignal(remote_view_target, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_endview))
|
RegisterSignal(remote_view_target, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_forced_endview))
|
||||||
|
|
||||||
/datum/component/remote_view/Destroy(force)
|
/datum/component/remote_view/Destroy(force)
|
||||||
. = ..()
|
. = ..()
|
||||||
@@ -77,8 +77,15 @@
|
|||||||
end_view()
|
end_view()
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
|
/// By default pass this down, but we need unique handling for subtypes sometimes
|
||||||
|
/datum/component/remote_view/proc/handle_forced_endview(datum/source)
|
||||||
|
SIGNAL_HANDLER
|
||||||
|
PROTECTED_PROC(TRUE)
|
||||||
|
handle_endview(source)
|
||||||
|
|
||||||
/datum/component/remote_view/proc/handle_endview(datum/source)
|
/datum/component/remote_view/proc/handle_endview(datum/source)
|
||||||
SIGNAL_HANDLER
|
SIGNAL_HANDLER
|
||||||
|
SHOULD_NOT_OVERRIDE(TRUE)
|
||||||
PRIVATE_PROC(TRUE)
|
PRIVATE_PROC(TRUE)
|
||||||
if(!host_mob)
|
if(!host_mob)
|
||||||
return
|
return
|
||||||
@@ -151,7 +158,7 @@
|
|||||||
RegisterSignal(host_item, COMSIG_QDELETING, PROC_REF(handle_endview))
|
RegisterSignal(host_item, COMSIG_QDELETING, PROC_REF(handle_endview))
|
||||||
RegisterSignal(host_item, COMSIG_MOVABLE_MOVED, PROC_REF(handle_endview))
|
RegisterSignal(host_item, COMSIG_MOVABLE_MOVED, PROC_REF(handle_endview))
|
||||||
RegisterSignal(host_item, COMSIG_ITEM_DROPPED, PROC_REF(handle_endview))
|
RegisterSignal(host_item, COMSIG_ITEM_DROPPED, PROC_REF(handle_endview))
|
||||||
RegisterSignal(host_item, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_endview))
|
RegisterSignal(host_item, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_forced_endview))
|
||||||
// If the user has already limited their HUD this avoids them having a HUD when they zoom in
|
// If the user has already limited their HUD this avoids them having a HUD when they zoom in
|
||||||
if(host_mob.hud_used.hud_shown)
|
if(host_mob.hud_used.hud_shown)
|
||||||
host_mob.toggle_zoom_hud()
|
host_mob.toggle_zoom_hud()
|
||||||
@@ -257,7 +264,7 @@
|
|||||||
view_coordinator = coordinator
|
view_coordinator = coordinator
|
||||||
view_coordinator.look(host_mob)
|
view_coordinator.look(host_mob)
|
||||||
LAZYDISTINCTADD(viewers, WEAKREF(host_mob))
|
LAZYDISTINCTADD(viewers, WEAKREF(host_mob))
|
||||||
RegisterSignal(view_coordinator, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_endview))
|
RegisterSignal(view_coordinator, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_forced_endview))
|
||||||
// If you get this crash, it's because check_eye() in look() failed
|
// If you get this crash, it's because check_eye() in look() failed
|
||||||
if(!parent)
|
if(!parent)
|
||||||
CRASH("Remoteview failed, look() cancelled view during component Initilize. Usually this is caused by check_eye().")
|
CRASH("Remoteview failed, look() cancelled view during component Initilize. Usually this is caused by check_eye().")
|
||||||
@@ -353,6 +360,20 @@
|
|||||||
cache_mob.client.perspective = EYE_PERSPECTIVE // --this is required too.
|
cache_mob.client.perspective = EYE_PERSPECTIVE // --this is required too.
|
||||||
if(!isturf(cache_mob.loc)) // For stuff like paicards
|
if(!isturf(cache_mob.loc)) // For stuff like paicards
|
||||||
cache_mob.AddComponent(/datum/component/recursive_move) // Will rebuild parent chain.
|
cache_mob.AddComponent(/datum/component/recursive_move) // Will rebuild parent chain.
|
||||||
|
// Because nested vore bellies do NOT get handled correctly for recursive prey. We need to tell the belly's occupants to decouple too... Then their own belly's occupants...
|
||||||
|
// Yes, two loops is faster. Because we skip typechecking byondcode side and instead do it engine side when getting the contents of the mob,
|
||||||
|
// we also skip typechecking every /obj in the mob on the byondcode side... Evil wizard knowledge.
|
||||||
|
for(var/obj/belly/check_belly in cache_mob.contents)
|
||||||
|
SEND_SIGNAL(check_belly, COMSIG_REMOTE_VIEW_CLEAR)
|
||||||
|
for(var/obj/item/dogborg/sleeper/check_sleeper in cache_mob.contents)
|
||||||
|
SEND_SIGNAL(check_sleeper, COMSIG_REMOTE_VIEW_CLEAR)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
|
/// We were forcibly disconnected, this situation is probably a recursive hellscape, so just decouple entirely and fix it when someone moves.
|
||||||
|
/datum/component/remote_view/mob_holding_item/handle_forced_endview(atom/source)
|
||||||
|
if(!host_mob)
|
||||||
|
return
|
||||||
|
needs_to_decouple = TRUE
|
||||||
|
decouple_view_to_turf( host_mob, get_turf(host_mob))
|
||||||
|
|
||||||
#undef MAX_RECURSIVE
|
#undef MAX_RECURSIVE
|
||||||
|
|||||||
@@ -197,6 +197,7 @@
|
|||||||
anchored = TRUE
|
anchored = TRUE
|
||||||
unacidable = TRUE
|
unacidable = TRUE
|
||||||
dir = WEST
|
dir = WEST
|
||||||
|
flags = REMOTEVIEW_ON_ENTER
|
||||||
|
|
||||||
var/base_icon_state = "cryopod_0" //VOREStation Edit - New Icon
|
var/base_icon_state = "cryopod_0" //VOREStation Edit - New Icon
|
||||||
var/occupied_icon_state = "cryopod_1" //VOREStation Edit - New Icon
|
var/occupied_icon_state = "cryopod_1" //VOREStation Edit - New Icon
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
desc = "A standard recharger for all devices that use power."
|
desc = "A standard recharger for all devices that use power."
|
||||||
icon = 'icons/obj/stationobjs.dmi'
|
icon = 'icons/obj/stationobjs.dmi'
|
||||||
icon_state = "recharger0"
|
icon_state = "recharger0"
|
||||||
flags = REMOTEVIEW_ON_ENTER
|
|
||||||
anchored = TRUE
|
anchored = TRUE
|
||||||
use_power = USE_POWER_IDLE
|
use_power = USE_POWER_IDLE
|
||||||
idle_power_usage = 4
|
idle_power_usage = 4
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
density = TRUE
|
density = TRUE
|
||||||
anchored = TRUE
|
anchored = TRUE
|
||||||
unacidable = TRUE
|
unacidable = TRUE
|
||||||
|
flags = REMOTEVIEW_ON_ENTER
|
||||||
circuit = /obj/item/circuitboard/recharge_station
|
circuit = /obj/item/circuitboard/recharge_station
|
||||||
use_power = USE_POWER_IDLE
|
use_power = USE_POWER_IDLE
|
||||||
idle_power_usage = 50
|
idle_power_usage = 50
|
||||||
|
|||||||
@@ -887,6 +887,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
|||||||
return FALSE
|
return FALSE
|
||||||
if(isturf(client.mob.loc) && get_turf(client.eye) == get_turf(client.mob))
|
if(isturf(client.mob.loc) && get_turf(client.eye) == get_turf(client.mob))
|
||||||
return FALSE
|
return FALSE
|
||||||
|
if(ismecha(client.mob.loc) && client.eye == client.mob.loc)
|
||||||
|
return FALSE
|
||||||
return (client.eye != client.mob)
|
return (client.eye != client.mob)
|
||||||
|
|
||||||
#undef ADMINSWARNED_AT
|
#undef ADMINSWARNED_AT
|
||||||
|
|||||||
Reference in New Issue
Block a user