fix tools stock info
This commit is contained in:
parent
2af121b89b
commit
afbaf97f6a
@ -4,6 +4,7 @@ import (
|
|||||||
"mapserver/luaparser"
|
"mapserver/luaparser"
|
||||||
"mapserver/mapblockparser"
|
"mapserver/mapblockparser"
|
||||||
"mapserver/mapobjectdb"
|
"mapserver/mapobjectdb"
|
||||||
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -76,7 +77,7 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
|
|||||||
} else {
|
} else {
|
||||||
for _, item := range mainInv.Items {
|
for _, item := range mainInv.Items {
|
||||||
if item.Name == out_item {
|
if item.Name == out_item {
|
||||||
stock += item.Count
|
stock += int(math.Max(1, float64(item.Count)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user