Fix newly constructed lights always having cells

This commit is contained in:
Meghan-Rossi
2020-02-23 02:15:38 +00:00
parent 32ae9e406b
commit f860c76792

View File

@@ -272,13 +272,14 @@ var/global/list/light_type_cache = list()
/obj/machinery/light/flamp/New(atom/newloc, obj/machinery/light_construct/construct = null)
..(newloc, construct)
if(start_with_cell && !no_emergency)
cell = new/obj/item/weapon/cell/emergency_light(src)
if(construct)
start_with_cell = FALSE
lamp_shade = 0
update_icon()
else
if(start_with_cell && !no_emergency)
cell = new/obj/item/weapon/cell/emergency_light(src)
/obj/machinery/light/flamp/flicker
auto_flicker = TRUE
@@ -302,8 +303,6 @@ var/global/list/light_type_cache = list()
/obj/machinery/light/New(atom/newloc, obj/machinery/light_construct/construct = null)
..(newloc)
if(start_with_cell && !no_emergency)
cell = new/obj/item/weapon/cell/emergency_light(src)
if(construct)
start_with_cell = FALSE
status = LIGHT_EMPTY
@@ -311,6 +310,8 @@ var/global/list/light_type_cache = list()
construct.transfer_fingerprints_to(src)
set_dir(construct.dir)
else
if(start_with_cell && !no_emergency)
cell = new/obj/item/weapon/cell/emergency_light(src)
var/obj/item/weapon/light/L = get_light_type_instance(light_type)
update_from_bulb(L)
if(prob(L.broken_chance))