ZAS Performance Improvements (#2308)

This PR converts ZAS' c_airblock procs into a single macro for performance reasons, as well as allows CanPass to be bypassed for atoms that do not require special air blocking behavior.

Appears to have a significant effect on performance, needs more detailed testing.

Some objects are likely missing canpass flags, I only set the obvious ones. Please comment if you find one I missed.

Might fix #2152.
This commit is contained in:
Lohikar
2017-05-20 19:00:15 +03:00
committed by skull132
parent 4ade21551e
commit d8b6ba2c6c
12 changed files with 130 additions and 53 deletions
+32 -29
View File
@@ -36,6 +36,8 @@
icon = 'icons/obj/inflatable.dmi'
icon_state = "wall"
atmos_canpass = CANPASS_DENSITY
var/undeploy_path = null
var/health = 50.0
@@ -113,10 +115,12 @@
if(!undeploy_path)
return
visible_message("\The [src] slowly deflates.")
spawn(50)
var/obj/item/inflatable/R = new undeploy_path(src.loc)
src.transfer_fingerprints_to(R)
qdel(src)
addtimer(CALLBACK(src, .proc/post_deflate), 26)
/obj/structure/inflatable/proc/post_deflate()
var/obj/item/inflatable/R = new undeploy_path(src.loc)
src.transfer_fingerprints_to(R)
qdel(src)
/obj/structure/inflatable/verb/hand_deflate()
set name = "Deflate"
@@ -134,7 +138,7 @@
user.do_attack_animation(src)
if(health <= 0)
user.visible_message("<span class='danger'>[user] [attack_verb] open the [src]!</span>")
spawn(1) deflate(1)
addtimer(CALLBACK(src, .proc/deflate, 1), 1)
else
user.visible_message("<span class='danger'>[user] [attack_verb] at [src]!</span>")
return 1
@@ -190,28 +194,30 @@
update_nearby_tiles()
/obj/structure/inflatable/door/proc/Open()
spawn()
if(isSwitchingStates) return
isSwitchingStates = 1
flick("door_opening",src)
sleep(10)
density = 0
opacity = 0
state = 1
update_icon()
isSwitchingStates = 0
set waitfor = FALSE
if(isSwitchingStates)
return
isSwitchingStates = 1
flick("door_opening",src)
sleep(10)
density = 0
opacity = 0
state = 1
update_icon()
isSwitchingStates = 0
/obj/structure/inflatable/door/proc/Close()
spawn()
if(isSwitchingStates) return
isSwitchingStates = 1
flick("door_closing",src)
sleep(10)
density = 1
opacity = 0
state = 0
update_icon()
isSwitchingStates = 0
set waitfor = FALSE
if(isSwitchingStates)
return
isSwitchingStates = 1
flick("door_closing",src)
sleep(10)
density = 1
opacity = 0
state = 0
update_icon()
isSwitchingStates = 0
/obj/structure/inflatable/door/update_icon()
if(state)
@@ -228,10 +234,7 @@
qdel(src)
else
visible_message("[src] slowly deflates.")
spawn(50)
var/obj/item/inflatable/door/R = new /obj/item/inflatable/door(loc)
src.transfer_fingerprints_to(R)
qdel(src)
addtimer(CALLBACK(src, .proc/post_deflate), 26)
/obj/item/inflatable/torn
name = "torn inflatable wall"
+2
View File
@@ -20,6 +20,8 @@
var/glasstype = null // Set this in subtypes. Null is assumed strange or otherwise impossible to dismantle, such as for shuttle glass.
var/silicate = 0 // number of units of silicate
atmos_canpass = CANPASS_PROC
/obj/structure/window/examine(mob/user)
. = ..(user)