1
0
forked from MTSR/mapserver

revert depositor mess

This commit is contained in:
Thomas Rudin 2019-08-05 16:44:05 +02:00
parent f58e4b6f19
commit 55ba9b2811

View File

@ -19,16 +19,11 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
parser := luaparser.New()
isAdmin := false
isDepositor := false
if nodename == "fancy_vend:admin_vendor" || nodename == "fancy_vend:admin_depo" {
isAdmin = true
}
if nodename == "fancy_vend:player_depo" || nodename == "fancy_vend:admin_depo" {
isDepositor = true
}
payInv := invMap["wanted_item"]
giveInv := invMap["given_item"]
mainInv := invMap["main"]
@ -93,19 +88,11 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
o.Attributes["owner"] = md["owner"]
o.Attributes["type"] = "fancyvend"
if !isDepositor {
o.Attributes["in_item"] = in_item
o.Attributes["in_count"] = strconv.Itoa(in_count)
o.Attributes["out_item"] = out_item
o.Attributes["out_count"] = strconv.Itoa(out_count)
} else {
// invert in and out
o.Attributes["out_item"] = in_item
o.Attributes["out_count"] = strconv.Itoa(in_count)
o.Attributes["in_item"] = out_item
o.Attributes["in_count"] = strconv.Itoa(out_count)
}
o.Attributes["stock"] = strconv.Itoa(stock_factor)
return o