mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-10-25 20:22:25 +00:00
Prevent fractional charge leftovers in capacitors (bdew/generators#43)
This commit is contained in:
1 parent
89b54300e3
commit
f2cdba7800
1 file changed
+1
@@ -34,6 +34,7 @@ case class DataSlotPower(name: String, parent: DataSlotContainer) extends DataSl
|
||||
val canExtract = Misc.clamp(v, 0F, stored)
|
||||
if ((canExtract > 0) && !simulate) {
|
||||
stored -= canExtract
|
||||
if (stored < 1) stored = 0
|
||||
parent.dataSlotChanged(this)
|
||||
}
|
||||
return canExtract
|
||||
|
||||
Reference in new issue
Block a user