mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
fix: stop charging plasma mod core when full (#24055)
This commit is contained in:
@@ -233,7 +233,7 @@
|
||||
mod.update_charge_alert()
|
||||
|
||||
/obj/item/mod/core/plasma
|
||||
name = "MOD plasma core"
|
||||
name = "\improper MOD plasma core"
|
||||
desc = "Nanotrasen's attempt at capitalizing on their plasma research. These plasma cores are refueled \
|
||||
through plasma fuel, allowing for easy continued use by their mining squads."
|
||||
icon_state = "mod-core-plasma"
|
||||
@@ -290,6 +290,10 @@
|
||||
var/charge_given = is_type_in_list(plasma, charger_list)
|
||||
if(!charge_given)
|
||||
return FALSE
|
||||
if(charge_amount() == max_charge_amount())
|
||||
to_chat(user, "<span class='notice'>[src] is already fully charged!</span>")
|
||||
// We didn't succeed but we don't want to treat it as an attackby
|
||||
return TRUE
|
||||
var/uses_needed = min(plasma.amount, ((max_charge_amount() - charge_amount()) / 2000))
|
||||
if(!plasma.use(uses_needed))
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user