Fixes bubble/hull shield generators not updating air zones, update_nearby_tiles() cleanup.

This commit is contained in:
mwerezak
2014-11-25 18:10:19 -05:00
committed by mwerezak
parent af579e0e25
commit b84bb4ff23
12 changed files with 41 additions and 67 deletions

View File

@@ -27,16 +27,6 @@
if(!height || air_group) return 0
else return ..()
//Looks like copy/pasted code... I doubt 'need_rebuild' is even used here - Nodrak
/obj/machinery/shield/proc/update_nearby_tiles(need_rebuild)
if(!air_master)
return 0
air_master.mark_for_update(get_turf(src))
return 1
/obj/machinery/shield/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(!istype(W)) return
@@ -357,4 +347,4 @@
src.icon_state = malfunction ? "shieldonbr":"shieldon"
else
src.icon_state = malfunction ? "shieldoffbr":"shieldoff"
return
return

View File

@@ -13,6 +13,14 @@
var/strength = 0
var/ticks_recovering = 10
/obj/effect/energy_field/New()
..()
update_nearby_tiles()
/obj/effect/energy_field/Del()
update_nearby_tiles()
..()
/obj/effect/energy_field/ex_act(var/severity)
Stress(0.5 + severity)
@@ -44,12 +52,16 @@
strength = 0
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
var/old_density = density
if(strength >= 1)
invisibility = 0
density = 1
else if(strength < 1)
invisibility = 101
density = 0
if (density != old_density)
update_nearby_tiles()
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
//Purpose: Determines if the object (or airflow) can pass this atom.

View File

@@ -242,6 +242,7 @@
/obj/machinery/shieldwall/New(var/obj/machinery/shieldwallgen/A, var/obj/machinery/shieldwallgen/B)
..()
update_nearby_tiles()
src.gen_primary = A
src.gen_secondary = B
if(A && B && A.active && B.active)
@@ -253,6 +254,10 @@
else
del(src) //need at least two generator posts
/obj/machinery/shieldwall/Del()
update_nearby_tiles()
..()
/obj/machinery/shieldwall/attack_hand(mob/user as mob)
return
@@ -321,4 +326,4 @@
if (istype(mover, /obj/item/projectile))
return prob(10)
else
return !src.density
return !src.density