Begin, the Lag Wars Have (#21839)

<img width="700" height="848" alt="image"
src="https://github.com/user-attachments/assets/e0db50af-35db-43c7-b78e-6c1ea5ac569c"
/>

you take a tiny little two year LOA and this happens
this PR hits some large lag culprits:
- UpdateOverlays() getting spammed by human/update_icon. This was 0.85%
of server CPU time during the event. Doesn't sound like a whole lot but
it's insane. 99% of it was caused by sloppy duplicate calls of
update_icon in set_dir (as well as update icon itself!). Refactored to
stop that
- Makes Follow menu update manually, which cuts down on the 2.8 million
REF() calls it made during the event. This was ~1% of CPU time including
ui_data as well.
- Gets rid of a bunch of random runtimes and some lighting-related
harddels.
- NanoUIs now clean themselves up when their owner qdels rather than
forcing the owner to do REF(src) and close all matching UIs. saves us
~0.1% server cpu time! wowza!
This commit is contained in:
Wildkins
2026-02-09 23:20:48 +00:00
committed by GitHub
parent 6ad39a46f7
commit 3d183d7262
19 changed files with 103 additions and 80 deletions
+3 -3
View File
@@ -132,13 +132,12 @@
set category = "Ghost"
set desc = "Follow and haunt a mob."
var/datum/tgui_module/follow_menu/GM = new /datum/tgui_module/follow_menu(usr)
GM.ui_interact(usr)
GLOB.follow_menu.ui_interact(src)
// This is the ghost's follow verb with an argument
/mob/abstract/ghost/proc/ManualFollow(var/atom/movable/target)
if(!target)
return
return FALSE
//Stops orbit if there's any; TG doesn't do this, but if you don't it breaks the orbiting reference
//if you are jumping from one mob to another, hence why we're doing it here
@@ -154,6 +153,7 @@
to_chat(src, SPAN_NOTICE("Now following \the <b>[target]</b>."))
update_sight()
return TRUE
/mob/abstract/ghost/proc/update_sight()
//if they are on a restricted level, then set the ghost vision for them.