Skip to content

Commit

Permalink
bugfix: Removed machinery caching in late initialize (#4317)
Browse files Browse the repository at this point in the history
* bugfix: Removed machinery caching in late initialize

* Decided to move cache handling into Initialize, because doors were broken

* Fixed non-area handling in machinery initialize
  • Loading branch information
Vladisvell authored Jan 31, 2024
1 parent d7ae0ba commit 1346f8d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions code/game/machinery/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ Class Procs:

if(use_power)
myArea = get_area(src)
if(myArea)
RegisterSignal(myArea, COMSIG_AREA_EXITED, PROC_REF(onAreaExited))
LAZYADD(myArea.machinery_cache, src)

if(!speed_process)
START_PROCESSING(SSmachines, src)
Expand All @@ -161,13 +164,6 @@ Class Procs:

init_multitool_menu()

return INITIALIZE_HINT_LATELOAD

/obj/machinery/LateInitialize()
if(myArea)
RegisterSignal(myArea, COMSIG_AREA_EXITED, PROC_REF(onAreaExited))
LAZYADD(myArea.machinery_cache, src)

/obj/machinery/proc/onAreaExited()
if(myArea == get_area(src))
return
Expand Down

0 comments on commit 1346f8d

Please sign in to comment.