mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-21 04:32:32 +00:00
Prevent leftover fractional resources due to FP rounding errors
This commit is contained in:
1 parent
5e7c8bda2f
commit
573330efd3
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ buildscript {
|
||||
apply plugin: 'scala'
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.6.0"
|
||||
version = "1.6.1"
|
||||
|
||||
if (project.hasProperty('buildnum')) {
|
||||
project.version = project.version + '.' + project.buildnum
|
||||
|
||||
@@ -56,7 +56,7 @@ class DataSlotResource(val name: String, val parent: TileDataSlots, initCapacity
|
||||
if (onlyRound) canDrain = canDrain.floor
|
||||
if (doDrain) execWithChangeNotify {
|
||||
resource =
|
||||
if (canDrain == res.amount)
|
||||
if (res.amount - canDrain < 0.000001)
|
||||
None
|
||||
else
|
||||
Some(Resource(res.kind, res.amount - canDrain))
|
||||
|
||||
Reference in new issue
Block a user