Merge pull request #41787 from subject217/pcfix

Fixes an issue wherein plasma cutters accepted infinite plasma
This commit is contained in:
moo
2018-12-06 01:44:54 -05:00
committed by yogstation13-bot
parent 8e85e64be1
commit 9062806334

View File

@@ -144,13 +144,17 @@
to_chat(user, "<span class='notice'>[src] is [round(cell.percent())]% charged.</span>")
/obj/item/gun/energy/plasmacutter/attackby(obj/item/I, mob/user)
var/charge_multiplier = 0 //2 = Refined stack, 1 = Ore
if(istype(I, /obj/item/stack/sheet/mineral/plasma))
charge_multiplier = 2
if(istype(I, /obj/item/stack/ore/plasma))
charge_multiplier = 1
if(charge_multiplier)
if(cell.charge == cell.maxcharge)
to_chat(user, "<span class='notice'>You try to insert [I] into [src], but it's fully charged.</span>") //my cell is round and full
return
I.use(1)
cell.give(1000)
to_chat(user, "<span class='notice'>You insert [I] in [src], recharging it.</span>")
else if(istype(I, /obj/item/stack/ore/plasma))
I.use(1)
cell.give(500)
cell.give(500*charge_multiplier)
to_chat(user, "<span class='notice'>You insert [I] in [src], recharging it.</span>")
else
..()