From 0a4131e9dc991c67cf7bb6a86658cb0afdc1972a Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 7 Jul 2015 12:55:39 +0200 Subject: [PATCH] Reduced Hell Universe Lag Based on https://github.com/d3athrow/vgstation13/pull/5273. --- code/__HELPERS/unsorted.dm | 17 --------------- code/game/gamemodes/cult/cultify/obj.dm | 17 ++++----------- code/game/turfs/turf_flick_animations.dm | 21 +++++++++++++++++++ .../living/simple_animal/hostile/hostile.dm | 1 + 4 files changed, 26 insertions(+), 30 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 31c885d886..3e5a552895 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -560,23 +560,6 @@ proc/GaussRand(var/sigma) proc/GaussRandRound(var/sigma,var/roundto) return round(GaussRand(sigma),roundto) -proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,flick_anim as text,sleeptime = 0,direction as num) -//This proc throws up either an icon or an animation for a specified amount of time. -//The variables should be apparent enough. - var/atom/movable/overlay/animation = new(location) - if(direction) - animation.set_dir(direction) - animation.icon = a_icon - animation.layer = target:layer+1 - if(a_icon_state) - animation.icon_state = a_icon_state - else - animation.icon_state = "blank" - animation.master = target - flick(flick_anim, animation) - sleep(max(sleeptime, 15)) - qdel(animation) - //Will return the contents of an atom recursivly to a depth of 'searchDepth' /atom/proc/GetAllContents(searchDepth = 5) var/list/toReturn = list() diff --git a/code/game/gamemodes/cult/cultify/obj.dm b/code/game/gamemodes/cult/cultify/obj.dm index 4306182eaf..405ea6b29c 100644 --- a/code/game/gamemodes/cult/cultify/obj.dm +++ b/code/game/gamemodes/cult/cultify/obj.dm @@ -63,19 +63,10 @@ ..() /obj/machinery/door/cultify() - icon_state = "null" - density = 0 - c_animation = new /atom/movable/overlay(src.loc) - c_animation.name = "cultification" - c_animation.density = 0 - c_animation.anchored = 1 - c_animation.icon = 'icons/effects/effects.dmi' - c_animation.layer = 5 - c_animation.master = src.loc - c_animation.icon_state = "breakdoor" - flick("cultification",c_animation) - spawn(10) - qdel(c_animation) + if(invisibility != INVISIBILITY_MAXIMUM) + invisibility = INVISIBILITY_MAXIMUM + density = 0 + anim(target = src, a_icon = 'icons/effects/effects.dmi', a_icon_state = "breakdoor", sleeptime = 10) qdel(src) /obj/machinery/door/firedoor/cultify() diff --git a/code/game/turfs/turf_flick_animations.dm b/code/game/turfs/turf_flick_animations.dm index b1bccd51bc..9bcd5caaa9 100644 --- a/code/game/turfs/turf_flick_animations.dm +++ b/code/game/turfs/turf_flick_animations.dm @@ -19,3 +19,24 @@ if(c_animation) qdel(c_animation) c_animation = null + +proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,flick_anim as text,sleeptime = 0,direction as num) +//This proc throws up either an icon or an animation for a specified amount of time. +//The variables should be apparent enough. + if(!location && target) + location = get_turf(target) + if(location && !target) + target = location + var/atom/movable/overlay/animation = PoolOrNew(/atom/movable/overlay, location) + if(direction) + animation.set_dir(direction) + animation.icon = a_icon + animation.layer = target:layer+1 + if(a_icon_state) + animation.icon_state = a_icon_state + else + animation.icon_state = "blank" + animation.master = target + flick(flick_anim, animation) + spawn(max(sleeptime, 15)) + qdel(animation) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 8e29e21008..405386a827 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -212,6 +212,7 @@ /mob/living/simple_animal/hostile/proc/check_horde() + return 0 if(emergency_shuttle.shuttle.location) if(!enroute && !target_mob) //The shuttle docked, all monsters rush for the escape hallway if(!shuttletarget && escape_list.len) //Make sure we didn't already assign it a target, and that there are targets to pick