mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Stack material use now depends on charge costs.
This ensures one does not have to remember to set uses_charge equal to the length of the charge_cost list. Fixes #10943.
This commit is contained in:
@@ -191,7 +191,7 @@
|
||||
else
|
||||
if(get_amount() < used)
|
||||
return 0
|
||||
for(var/i = 1 to uses_charge)
|
||||
for(var/i = 1 to charge_costs.len)
|
||||
var/datum/matter_synth/S = synths[i]
|
||||
S.use_charge(charge_costs[i] * used) // Doesn't need to be deleted
|
||||
return 1
|
||||
@@ -264,8 +264,8 @@
|
||||
return 0
|
||||
var/datum/matter_synth/S = synths[1]
|
||||
. = round(S.get_charge() / charge_costs[1])
|
||||
if(uses_charge > 1)
|
||||
for(var/i = 2 to uses_charge)
|
||||
if(charge_costs.len > 1)
|
||||
for(var/i = 2 to charge_costs.len)
|
||||
S = synths[i]
|
||||
. = min(., round(S.get_charge() / charge_costs[i]))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user