mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Fixes a bunch of callbacks that were being qdeleted, and code cleanup (#77904)
## About The Pull Request  Continuing the work of https://github.com/tgstation/tgstation/pull/77850. it started with finding one that was being missed and causing a runtime...then I noticed a whole lot more. While I was doing this I found callbacks that weren't being nulled in `Destroy()`, so I added that wherever I found these spots as well as some general code cleanup. There were a lot more of these than I initially hoped to encounter so I'm labeling it as a refactor. ## Why It's Good For The Game Fixes lots of runtimes, improves code resiliency. ## Changelog 🆑 refactor: fixed a bunch of instances of callbacks being qdeleted and cleaned up related code /🆑
This commit is contained in:
@@ -25,6 +25,13 @@
|
||||
src.telegraph_duration = telegraph_duration
|
||||
src.on_began_forecast = on_began_forecast
|
||||
|
||||
/datum/component/basic_mob_attack_telegraph/Destroy(force, silent)
|
||||
if(current_target)
|
||||
forget_target(current_target)
|
||||
target_overlay = null
|
||||
on_began_forecast = null
|
||||
return ..()
|
||||
|
||||
/datum/component/basic_mob_attack_telegraph/RegisterWithParent()
|
||||
. = ..()
|
||||
RegisterSignal(parent, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, PROC_REF(on_attack))
|
||||
|
||||
Reference in New Issue
Block a user