Merge pull request #10239 from mwerezak/lighting-fix

Fixes #10210
This commit is contained in:
Zuhayr
2015-07-19 20:13:55 +09:30
3 changed files with 4 additions and 12 deletions

View File

@@ -34,7 +34,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/debug = 0 var/debug = 0
var/requires_power = 1 var/requires_power = 1
var/unlimited_power = 0
var/always_unpowered = 0 //this gets overriden to 1 for space in area/New() var/always_unpowered = 0 //this gets overriden to 1 for space in area/New()
var/power_equip = 1 var/power_equip = 1
@@ -349,7 +348,6 @@ area/space/atmosalert()
name = "\improper Centcom" name = "\improper Centcom"
icon_state = "centcom" icon_state = "centcom"
requires_power = 0 requires_power = 0
unlimited_power = 1
lighting_use_dynamic = 0 lighting_use_dynamic = 0
/area/centcom/control /area/centcom/control
@@ -388,7 +386,6 @@ area/space/atmosalert()
name = "\improper Mercenary Base" name = "\improper Mercenary Base"
icon_state = "syndie-ship" icon_state = "syndie-ship"
requires_power = 0 requires_power = 0
unlimited_power = 1
lighting_use_dynamic = 0 lighting_use_dynamic = 0
/area/syndicate_mothership/control /area/syndicate_mothership/control
@@ -463,7 +460,6 @@ area/space/atmosalert()
name = "\improper Independant Station" name = "\improper Independant Station"
icon_state = "yellow" icon_state = "yellow"
requires_power = 0 requires_power = 0
unlimited_power = 1
flags = RAD_SHIELDED flags = RAD_SHIELDED
/area/syndicate_station/start /area/syndicate_station/start

View File

@@ -28,8 +28,7 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
user << "\red \A [charging] is already charging here." user << "\red \A [charging] is already charging here."
return return
// Checks to make sure he's not in space doing it, and that the area got proper power. // Checks to make sure he's not in space doing it, and that the area got proper power.
var/area/a = get_area(src) if(!powered())
if(!isarea(a) || (a.power_equip == 0 && !a.unlimited_power))
user << "\red The [name] blinks red as you try to insert the item!" user << "\red The [name] blinks red as you try to insert the item!"
return return
if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow)) if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow))

View File

@@ -189,9 +189,7 @@
..() ..()
spawn(2) spawn(2)
var/area/A = get_area(src) on = has_power()
if(A && !A.requires_power)
on = 1
switch(fitting) switch(fitting)
if("tube") if("tube")
@@ -393,7 +391,7 @@
// true if area has power and lightswitch is on // true if area has power and lightswitch is on
/obj/machinery/light/proc/has_power() /obj/machinery/light/proc/has_power()
var/area/A = src.loc.loc var/area/A = src.loc.loc
return A.lightswitch && A.power_light return A.lightswitch && (!A.requires_power || A.power_light)
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) /obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
if(flickering) return if(flickering) return
@@ -565,8 +563,7 @@
// called when area power state changes // called when area power state changes
/obj/machinery/light/power_change() /obj/machinery/light/power_change()
spawn(10) spawn(10)
var/area/A = src.loc.loc seton(has_power())
seton(A.lightswitch && A.power_light)
// called when on fire // called when on fire