mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-15 01:46:30 +01:00
Lag War Day 5: Hard Dels and Status Displays (#21888)
- status displays no longer delete 50 overlays a second - fauna spawners no longer cause carp harddels - ammo piles and rocket launchers no longer cause harddels
This commit is contained in:
@@ -24,15 +24,24 @@
|
||||
/obj/effect/fauna_spawner/Initialize()
|
||||
. = ..()
|
||||
var/obj/effect/landmark/mob_waypoint/W = locate(/obj/effect/landmark/mob_waypoint) in world
|
||||
RegisterSignal(GLOB, COMSIG_GLOB_MOB_DEATH, PROC_REF(mob_died))
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_MOB_DEATH, PROC_REF(mob_died))
|
||||
if (W && W.z == src.z)
|
||||
waypoint = W
|
||||
if(!islist(GLOB.fauna_spawners))
|
||||
GLOB.fauna_spawners = list()
|
||||
GLOB.fauna_spawners |= src
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/effect/fauna_spawner/LateInitialize()
|
||||
waypoint = LAZYACCESS(GLOB.mob_waypoints, z)
|
||||
if(!istype(waypoint))
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/fauna_spawner/Destroy()
|
||||
UnregisterSignal(GLOB, COMSIG_GLOB_MOB_DEATH, PROC_REF(mob_died))
|
||||
for(var/mob/m in active_mobs)
|
||||
UnregisterSignal(m, COMSIG_QDELETING)
|
||||
active_mobs.Cut()
|
||||
if(islist(GLOB.fauna_spawners))
|
||||
GLOB.fauna_spawners -= src
|
||||
return ..()
|
||||
@@ -71,7 +80,7 @@
|
||||
if (!new_mob)
|
||||
return
|
||||
active_mobs += new_mob
|
||||
RegisterSignal(new_mob, COMSIG_GLOB_MOB_DEATH, PROC_REF(mob_died))
|
||||
RegisterSignal(new_mob, COMSIG_QDELETING, PROC_REF(mob_died))
|
||||
if (src.waypoint && istype(new_mob, /mob/living/simple_animal/hostile))
|
||||
var/mob/living/simple_animal/hostile/H = new_mob
|
||||
H.target_waypoint = src.waypoint
|
||||
@@ -80,6 +89,8 @@
|
||||
GLOB.move_manager.move_towards(H, src.waypoint.loc, move_speed, TRUE)
|
||||
|
||||
/obj/effect/fauna_spawner/proc/mob_died(var/mob/living/mob_ref, gibbed)
|
||||
SIGNAL_HANDLER
|
||||
UnregisterSignal(mob_ref, COMSIG_QDELETING)
|
||||
for (var/i = length(active_mobs); i >= 1; i--)
|
||||
var/mob/living/M = active_mobs[i]
|
||||
if (!M || QDELETED(M) || M.stat == DEAD)
|
||||
@@ -171,7 +182,7 @@
|
||||
var/mob/living/new_mob = new mob_type(T)
|
||||
active_mobs += new_mob
|
||||
|
||||
RegisterSignal(new_mob, COMSIG_GLOB_MOB_DEATH, PROC_REF(mob_died))
|
||||
RegisterSignal(new_mob, COMSIG_QDELETING, PROC_REF(mob_died))
|
||||
if(src.waypoint && istype(new_mob, /mob/living/simple_animal/hostile))
|
||||
var/mob/living/simple_animal/hostile/H = new_mob
|
||||
H.target_waypoint = src.waypoint
|
||||
@@ -206,3 +217,15 @@
|
||||
|
||||
/obj/effect/landmark/mob_waypoint
|
||||
name = "mob waypoint"
|
||||
|
||||
/obj/effect/landmark/mob_waypoint/Initialize(mapload)
|
||||
. = ..()
|
||||
var/list/z_levels = GetConnectedZlevels(z)
|
||||
for(var/i in z_levels)
|
||||
LAZYADDASSOCLIST(GLOB.mob_waypoints, "[i]", src)
|
||||
|
||||
/obj/effect/landmark/mob_waypoint/Destroy()
|
||||
var/list/z_levels = GetConnectedZlevels(z)
|
||||
for(var/i in z_levels)
|
||||
LAZYREMOVEASSOC(GLOB.mob_waypoints, "[i]", src)
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user