From 591d2719f313c70be2580115e1af479ba747255f Mon Sep 17 00:00:00 2001 From: Anewbe Date: Fri, 14 Oct 2016 21:29:03 -0500 Subject: [PATCH] Should fix penlights asking for cells --- code/game/objects/items/devices/flashlight.dm | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index f8c79bf6784..4277dcdc944 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -101,12 +101,13 @@ user << "[tempdesc]" /obj/item/device/flashlight/attack_self(mob/user) - if(!isturf(user.loc)) - user << "You cannot turn the light on while in this [user.loc]." //To prevent some lighting anomalities. - return 0 - if(!cell || cell.charge == 0) - user << "You flick the switch on [src], but nothing happens." - return 0 + if(power_use) + if(!isturf(user.loc)) + user << "You cannot turn the light on while in this [user.loc]." //To prevent some lighting anomalities. + return 0 + if(!cell || cell.charge == 0) + user << "You flick the switch on [src], but nothing happens." + return 0 on = !on update_icon() user.update_action_buttons() @@ -181,15 +182,16 @@ return ..() /obj/item/device/flashlight/attackby(obj/item/weapon/W, mob/user as mob) - if(istype(W, /obj/item/weapon/cell)) - if(!cell) - user.drop_item() - W.loc = src - cell = W - user << "You install a cell in \the [src]." - update_icon() - else - user << "\The [src] already has a cell." + if(power_use) + if(istype(W, /obj/item/weapon/cell)) + if(!cell) + user.drop_item() + W.loc = src + cell = W + user << "You install a cell in \the [src]." + update_icon() + else + user << "\The [src] already has a cell." else ..()