Burning objects are processed every tick now instead of using a spawn() check

This commit is contained in:
Ikarrus
2015-06-27 09:22:14 -06:00
parent 6cc17a6243
commit 59ca40f03d
4 changed files with 21 additions and 13 deletions
+7 -2
View File
@@ -9,6 +9,7 @@ var/datum/subsystem/objects/SSobj
priority = 12
var/list/processing = list()
var/list/burning = list()
/datum/subsystem/objects/New()
NEW_SS_GLOBAL(SSobj)
@@ -37,5 +38,9 @@ var/datum/subsystem/objects/SSobj
++i
continue
SSobj.processing.Cut(i, i+1)
for(var/obj/burningobj in SSobj.burning)
if(burningobj && (burningobj.burn_state == 1))
if(burningobj.burn_world_time < world.time)
burningobj.burn()
else
SSobj.burning -= burningobj
+7 -8
View File
@@ -11,6 +11,7 @@
var/burn_state = -1 // -1=fireproof | 0=will burn in fires | 1=currently on fire
var/burntime = 10 //How long it takes to burn to ashes, in seconds
var/burn_world_time //What world time the object will burn up completely
/obj/Destroy()
if(!istype(src, /obj/machinery))
@@ -163,23 +164,21 @@
/obj/fire_act(var/global_overlay=1)
if(!burn_state)
burn_state = 1
SSobj.burning += src
burn_world_time = world.time + burntime*10
if(global_overlay)
overlays += fire_overlay
spawn(burntime*10)
if(burn_state == 1)
burn()
return 1
/obj/proc/burn(var/visible=1)
/obj/proc/burn()
for(var/obj/item/Item in contents) //Empty out the contents
Item.loc = src.loc
Item.fire_act() //Set them on fire, too
if(visible)
src.visible_message("<span class='warning'>[src] burns away, leaving behind a pile of ashes.</span>")
new /obj/effect/decal/cleanable/ash(src.loc)
qdel(src)
/obj/proc/extinguish()
if(burn_state == 1)
burn_state = 0
overlays -= fire_overlay
overlays -= fire_overlay
SSobj.burning -= src
+6 -2
View File
@@ -1,5 +1,6 @@
/obj/item/clothing
name = "clothing"
burn_state = 0 //Burnable
var/flash_protect = 0 //Malk: What level of bright light protection item has. 1 = Flashers, Flashes, & Flashbangs | 2 = Welding | -1 = OH GOD WELDING BURNT OUT MY RETINAS
var/tint = 0 //Malk: Sets the item's level of visual impairment tint, normally set to the same as flash_protect
var/up = 0 // but seperated to allow items to protect but not impair vision, like space helmets
@@ -23,6 +24,7 @@
w_class = 1.0
throwforce = 0
slot_flags = SLOT_EARS
burn_state = -1 //Not Burnable
/obj/item/clothing/ears/earmuffs
name = "earmuffs"
@@ -32,7 +34,7 @@
flags = EARBANGPROTECT
strip_delay = 15
put_on_delay = 25
burn_state = 0 //Burnable
//Glasses
/obj/item/clothing/glasses
@@ -48,7 +50,7 @@
var/list/icon/current = list() //the current hud icons
strip_delay = 20
put_on_delay = 25
burn_state = -1 //Not Burnable
/*
SEE_SELF // can see self, no matter what
SEE_MOBS // can see all mobs, no matter what
@@ -180,6 +182,7 @@ BLIND // can't see anything
strip_delay = 50
put_on_delay = 50
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
burn_state = -1 //Not Burnable
/obj/item/clothing/suit/space
name = "space suit"
@@ -201,6 +204,7 @@ BLIND // can't see anything
max_heat_protection_temperature = SPACE_SUIT_MAX_TEMP_PROTECT
strip_delay = 80
put_on_delay = 80
burn_state = -1 //Not Burnable
//Under clothing
/obj/item/clothing/under
@@ -467,6 +467,6 @@
Shreds.desc = "The sad remains of what used to be a glorious [src.name]."
qdel(src)
else
burn(0)
burn()
return shredded