From afbaf97f6aa3d84fff0d71c9ba4c89543ba857de Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Sun, 14 Apr 2019 21:12:30 +0200 Subject: [PATCH] fix tools stock info --- server/mapobject/fancyvend.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/mapobject/fancyvend.go b/server/mapobject/fancyvend.go index 8efe099..95ffbaa 100644 --- a/server/mapobject/fancyvend.go +++ b/server/mapobject/fancyvend.go @@ -4,6 +4,7 @@ import ( "mapserver/luaparser" "mapserver/mapblockparser" "mapserver/mapobjectdb" + "math" "strconv" "github.com/sirupsen/logrus" @@ -76,7 +77,7 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock) } else { for _, item := range mainInv.Items { if item.Name == out_item { - stock += item.Count + stock += int(math.Max(1, float64(item.Count))) } } }