Merge pull request #10038 from PsiOmegaDelta/150707-HellUniverseOptimizations

Reduced Hell Universe Lag
This commit is contained in:
Chinsky
2015-07-09 20:45:51 +03:00
4 changed files with 26 additions and 30 deletions

View File

@@ -560,23 +560,6 @@ proc/GaussRand(var/sigma)
proc/GaussRandRound(var/sigma,var/roundto) proc/GaussRandRound(var/sigma,var/roundto)
return round(GaussRand(sigma),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' //Will return the contents of an atom recursivly to a depth of 'searchDepth'
/atom/proc/GetAllContents(searchDepth = 5) /atom/proc/GetAllContents(searchDepth = 5)
var/list/toReturn = list() var/list/toReturn = list()

View File

@@ -63,19 +63,10 @@
..() ..()
/obj/machinery/door/cultify() /obj/machinery/door/cultify()
icon_state = "null" if(invisibility != INVISIBILITY_MAXIMUM)
invisibility = INVISIBILITY_MAXIMUM
density = 0 density = 0
c_animation = new /atom/movable/overlay(src.loc) anim(target = src, a_icon = 'icons/effects/effects.dmi', a_icon_state = "breakdoor", sleeptime = 10)
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)
qdel(src) qdel(src)
/obj/machinery/door/firedoor/cultify() /obj/machinery/door/firedoor/cultify()

View File

@@ -19,3 +19,24 @@
if(c_animation) if(c_animation)
qdel(c_animation) qdel(c_animation)
c_animation = null 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)

View File

@@ -212,6 +212,7 @@
/mob/living/simple_animal/hostile/proc/check_horde() /mob/living/simple_animal/hostile/proc/check_horde()
return 0
if(emergency_shuttle.shuttle.location) if(emergency_shuttle.shuttle.location)
if(!enroute && !target_mob) //The shuttle docked, all monsters rush for the escape hallway 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 if(!shuttletarget && escape_list.len) //Make sure we didn't already assign it a target, and that there are targets to pick