mirror of
https://github.com/evilew/GS13-Citadel.git
synced 2026-08-22 20:57:32 +01:00
Merge pull request #183 from Be1aya/plumbing-stall-fix
Fix for issue with plumbing reaction chambers getting stuck on filling
This commit is contained in:
@@ -66,9 +66,15 @@
|
||||
var/datum/component/plumbing/supplier = A
|
||||
if(supplier.can_give(amount, reagent, net))
|
||||
valid_suppliers += supplier
|
||||
///GS13 Edit: Need to ask for each in turn very carefully, making sure we get the total volume. This is to avoid a division that would always round down and become 0
|
||||
var/targetVolume = reagents.total_volume = amount
|
||||
var/suppliersLeft = valid_suppliers.len
|
||||
for(var/A in valid_suppliers)
|
||||
var/datum/component/plumbing/give = A
|
||||
give.transfer_to(src, amount / valid_suppliers.len, reagent, net)
|
||||
//GS13 Edit: See above comment
|
||||
var/currentRequest = (targetVolume - reagents.total_volume) / suppliersLeft
|
||||
give.transfer_to(src, currentRequest, reagent, net)
|
||||
suppliersLeft--
|
||||
///returns TRUE when they can give the specified amount and reagent. called by process request
|
||||
/datum/component/plumbing/proc/can_give(amount, reagent, datum/ductnet/net)
|
||||
if(amount <= 0)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
var/datum/reagent/RD = A
|
||||
if(RT == RD.type)
|
||||
has_reagent = TRUE
|
||||
if(RD.volume < RC.required_reagents[RT])
|
||||
if(RD.volume + CHEMICAL_QUANTISATION_LEVEL < RC.required_reagents[RT]) //GS13 Edit: Allow the chamber to exit filling mode when it feels it has enough even if short by a tiny fraction
|
||||
process_request(min(RC.required_reagents[RT] - RD.volume, MACHINE_REAGENT_TRANSFER) , RT, dir)
|
||||
return
|
||||
if(!has_reagent)
|
||||
|
||||
Reference in New Issue
Block a user