Made glowshrooms and intercoms not use a ridiculous internal loop, and fixed a pickup luminosity bug with glowshrooms.
fixes #3708
Fixes #3718
Fixes #3702

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
Mloc-Argent
2013-10-07 20:35:26 +01:00
parent 06df06a0a3
commit ebf2ba2d4a
8 changed files with 33 additions and 20 deletions
+15 -9
View File
@@ -16,6 +16,8 @@
var/spreadChance = 40
var/spreadIntoAdjacentChance = 60
var/evolveChance = 2
var/lastTick = 0
var/spreaded = 1
/obj/effect/glowshroom/single
spreadChance = 0
@@ -40,15 +42,21 @@
else //if on the floor, glowshroom on-floor sprite
icon_state = "glowshroomf"
spawn(delay)
SetLuminosity(round(potency/10))
Spread()
processing_objects += src
/obj/effect/glowshroom/proc/Spread()
set background = 1
var/spreaded = 1
SetLuminosity(round(potency/10))
lastTick = world.timeofday
while(spreaded)
/obj/effect/glowshroom/Del()
processing_objects -= src
..()
/obj/effect/glowshroom/process()
if(!spreaded)
return
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
lastTick = world.timeofday
spreaded = 0
for(var/i=1,i<=yield,i++)
@@ -90,8 +98,6 @@
if(prob(evolveChance)) //very low chance to evolve on its own
potency += rand(4,6)
sleep(delay)
/obj/effect/glowshroom/proc/CalcDir(turf/location = loc)
set background = 1
var/direction = 16