mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
[MIRROR] Attempting to fix search_object hard dels (#29167)
* Attempting to fix search_object hard dels (#85394) ## About The Pull Request  These were coming up often, had a hunch that the callback may have been hanging their refs. It seems to be true from my testing, they should be passing GLOBAL_PROC as the `object` arg, not `src`, since qdel is not a `search_object` proc. (Thanks Melbert for noticing that detail!) Also just tidies up the code a bit, adding checks to prevent redundant qdel calls and preventing a potential race condition with qdeleted atoms. ## Why It's Good For The Game Hard dels here in particular have potential to cause significant lag and issues. ## Changelog Not player-facing really * Attempting to fix search_object hard dels --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
if(!istype(thing))
|
if(!istype(thing))
|
||||||
stack_trace("Non-atom in the contents of [source_turf]!")
|
stack_trace("Non-atom in the contents of [source_turf]!")
|
||||||
continue
|
continue
|
||||||
|
if(QDELETED(thing))
|
||||||
|
continue
|
||||||
if(thing.mouse_opacity == MOUSE_OPACITY_TRANSPARENT)
|
if(thing.mouse_opacity == MOUSE_OPACITY_TRANSPARENT)
|
||||||
continue
|
continue
|
||||||
if(thing.IsObscured())
|
if(thing.IsObscured())
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
/datum/search_object/Destroy(force)
|
/datum/search_object/Destroy(force)
|
||||||
item = null
|
item = null
|
||||||
|
icon = null
|
||||||
|
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
@@ -75,6 +76,9 @@
|
|||||||
/datum/search_object/proc/on_item_moved(atom/source)
|
/datum/search_object/proc/on_item_moved(atom/source)
|
||||||
SIGNAL_HANDLER
|
SIGNAL_HANDLER
|
||||||
|
|
||||||
|
if(QDELETED(src))
|
||||||
|
return
|
||||||
|
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
|
|
||||||
@@ -82,4 +86,4 @@
|
|||||||
/datum/search_object/proc/on_turf_change(turf/source, path, list/new_baseturfs, flags, list/post_change_callbacks)
|
/datum/search_object/proc/on_turf_change(turf/source, path, list/new_baseturfs, flags, list/post_change_callbacks)
|
||||||
SIGNAL_HANDLER
|
SIGNAL_HANDLER
|
||||||
|
|
||||||
post_change_callbacks += CALLBACK(src, GLOBAL_PROC_REF(qdel), src)
|
post_change_callbacks += CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src)
|
||||||
|
|||||||
Reference in New Issue
Block a user