fix multiple issues (#9366)

This commit is contained in:
Kashargul
2024-10-31 14:13:40 +01:00
committed by GitHub
parent 5084db6cdb
commit 427a420d51
8 changed files with 43 additions and 42 deletions

View File

@@ -202,12 +202,12 @@ SUBSYSTEM_DEF(statpanels)
return
var/list/overrides = list()
for(var/image/target_image as anything in target.images)
if(!target_image.loc || target_image.loc.loc != target_mob.listed_turf || !target_image.override)
if(!target_image.loc || target_image.loc.loc != target.tracked_turf || !target_image.override)
continue
overrides += target_image.loc
var/list/atoms_to_display = list(target_mob.listed_turf)
for(var/atom/movable/turf_content as anything in target_mob.listed_turf)
var/list/atoms_to_display = list(target.tracked_turf)
for(var/atom/movable/turf_content as anything in target.tracked_turf)
if(turf_content.mouse_opacity == MOUSE_OPACITY_TRANSPARENT)
continue
if(turf_content.invisibility > target_mob.see_invisible)
@@ -318,12 +318,11 @@ SUBSYSTEM_DEF(statpanels)
// Handle turfs
if(target_mob?.listed_turf)
if(!target_mob.TurfAdjacent(target_mob.listed_turf))
target.stat_panel.send_message("removed_listedturf")
target_mob.listed_turf = null
if(target.tracked_turf)
if(!target_mob.TurfAdjacent(target.tracked_turf))
target_mob.set_listed_turf(null)
else if(target.stat_tab == target_mob?.listed_turf.name || !(target_mob?.listed_turf.name in target.panel_tabs))
else if(target.stat_tab == target.tracked_turf.name || !(target.tracked_turf.name in target.panel_tabs))
set_turf_examine_tab(target, target_mob)
return TRUE
@@ -350,6 +349,8 @@ SUBSYSTEM_DEF(statpanels)
/// Stat panel window declaration
/client/var/datum/tgui_window/stat_panel
/// Turf examine turf
/client/var/turf/tracked_turf
/// Datum that holds and tracks info about a client's object window
/// Really only exists because I want to be able to do logic with signals
@@ -364,8 +365,6 @@ SUBSYSTEM_DEF(statpanels)
var/list/atoms_to_imagify = list()
/// Our owner client
var/client/parent
/// Are we currently tracking a turf?
var/actively_tracking = FALSE
///For reusing this logic for examines
var/atom/examine_target
var/flags = 0
@@ -417,28 +416,31 @@ SUBSYSTEM_DEF(statpanels)
if(!length(to_make))
return PROCESS_KILL
/datum/object_window_info/proc/start_turf_tracking()
if(actively_tracking)
/datum/object_window_info/proc/start_turf_tracking(turf/new_turf)
if(parent.tracked_turf)
stop_turf_tracking()
var/static/list/connections = list(
COMSIG_MOVABLE_MOVED = PROC_REF(on_mob_move),
COMSIG_MOB_LOGOUT = PROC_REF(on_mob_logout),
)
AddComponent(/datum/component/connect_mob_behalf, parent, connections)
RegisterSignal(parent.mob.listed_turf, COMSIG_ATOM_ENTERED, PROC_REF(turflist_changed))
RegisterSignal(parent.mob.listed_turf, COMSIG_ATOM_EXITED, PROC_REF(turflist_changed))
actively_tracking = TRUE
RegisterSignal(parent.tracked_turf, COMSIG_ATOM_ENTERED, PROC_REF(turflist_changed))
RegisterSignal(parent.tracked_turf, COMSIG_ATOM_EXITED, PROC_REF(turflist_changed))
parent.stat_panel.send_message("create_listedturf", new_turf)
parent.tracked_turf = new_turf
/datum/object_window_info/proc/stop_turf_tracking()
qdel(GetComponent(/datum/component/connect_mob_behalf))
UnregisterSignal(parent.mob.listed_turf, COMSIG_ATOM_ENTERED)
UnregisterSignal(parent.mob.listed_turf, COMSIG_ATOM_EXITED)
actively_tracking = FALSE
if(GetComponent(/datum/component/connect_mob_behalf))
qdel(GetComponent(/datum/component/connect_mob_behalf))
if(parent.tracked_turf)
UnregisterSignal(parent.tracked_turf, COMSIG_ATOM_ENTERED)
UnregisterSignal(parent.tracked_turf, COMSIG_ATOM_EXITED)
parent.stat_panel.send_message("remove_listedturf")
parent.tracked_turf = null
/datum/object_window_info/proc/on_mob_move(mob/source)
SIGNAL_HANDLER
var/turf/listed = source.listed_turf
if(!listed || !source.TurfAdjacent(listed))
if(!parent.tracked_turf || !source.TurfAdjacent(parent.tracked_turf))
source.set_listed_turf(null)
/datum/object_window_info/proc/on_mob_logout(mob/source)
@@ -465,16 +467,12 @@ SUBSYSTEM_DEF(statpanels)
/mob/proc/set_listed_turf(turf/new_turf)
if(!client)
listed_turf = new_turf
return
if(!client.obj_window)
client.obj_window = new(client)
if(client.tracked_turf == new_turf)
return
if(!new_turf)
client.obj_window.stop_turf_tracking() //Needs to go before listed_turf is set to null so signals can be removed
listed_turf = new_turf
if(listed_turf)
client.stat_panel.send_message("create_listedturf", listed_turf.name)
client.obj_window.start_turf_tracking()
else
client.stat_panel.send_message("remove_listedturf")
return
client.obj_window.start_turf_tracking(new_turf)

View File

@@ -95,6 +95,7 @@
if(new_character.client)
new_character.client.init_verbs() // re-initialize character specific verbs
new_character.set_listed_turf(null)
/datum/mind/proc/store_memory(new_text)
memory += "[new_text]<BR>"

View File

@@ -446,7 +446,7 @@
blob.mob_radio = R
R.forceMove(blob)
if(wear_id)
blob.myid = wear_id
blob.myid = wear_id.GetID()
wear_id.forceMove(blob)
//ChompAdd End
//Mail them to nullspace

View File

@@ -125,12 +125,16 @@
var/obj/machinery/vr_sleeper/V = vr_holder.loc
V.go_out()
//CHOMPAdd Start
if(died_in_vr)
spawn(3000) //Delete the body after 5 minutes to make sure mob subsystem doesn't cry
var/list/slots = list(slot_back,slot_handcuffed,slot_l_store,slot_r_store,slot_wear_mask,slot_l_hand,slot_r_hand,slot_wear_id,slot_glasses,slot_gloves,slot_head,slot_shoes,slot_belt,slot_wear_suit,slot_w_uniform,slot_s_store,slot_l_ear,slot_r_ear)
for(var/slot in slots)
var/obj/item/I = get_equipped_item(slot = slot)
if(I)
unEquip(I,force = TRUE)
release_vore_contents(include_absorbed = TRUE, silent = TRUE)
qdel(src)
addtimer(CALLBACK(src, PROC_REF(cleanup_vr)), 3000, TIMER_DELETE_ME) //Delete the body after 5 minutes
/mob/living/carbon/human/proc/cleanup_vr()
var/list/slots = list(slot_back,slot_handcuffed,slot_l_store,slot_r_store,slot_wear_mask,slot_l_hand,slot_r_hand,slot_wear_id,slot_glasses,slot_gloves,slot_head,slot_shoes,slot_belt,slot_wear_suit,slot_w_uniform,slot_s_store,slot_l_ear,slot_r_ear)
for(var/slot in slots)
var/obj/item/I = get_equipped_item(slot = slot)
if(I)
unEquip(I,force = TRUE)
release_vore_contents(include_absorbed = TRUE, silent = TRUE)
qdel(src)
//CHOMPAdd End

View File

@@ -208,7 +208,6 @@
//so don't treat them as being SSD even though their client var is null.
var/mob/teleop = null
var/turf/listed_turf = null //the current turf being examined in the stat panel
var/list/shouldnt_see = list(/mob/observer/eye) //list of objects that this mob shouldn't see in the stat panel. this silliness is needed because of AI alt+click and cult blood runes
var/list/active_genes=list()

View File

@@ -497,7 +497,7 @@
blob.mob_radio = R
R.forceMove(blob)
if(wear_id)
blob.myid = wear_id
blob.myid = wear_id.GetID()
wear_id.forceMove(blob)
//Mail them to nullspace

View File

@@ -163,7 +163,7 @@ Maybe later, gotta figure out a way to click yourself when in a locker etc.
new_mob.vore_organs += B
new_mob.nutrition = src.nutrition
src.soulgem.transfer_self(new_mob) //CHOMPAdd Soulcatcher
src.soulgem?.transfer_self(new_mob) //CHOMPAdd Soulcatcher
new_mob.ckey = src.ckey
if(new_mob.tf_form_ckey)

View File

@@ -1,3 +1,2 @@
/mob/living/simple_mob/vore/alienanimals/teppi/baby
mob_size = MOB_MEDIUM
allow_mind_transfer = TRUE