forked from MTSR/mapserver
revert depositor mess
This commit is contained in:
parent
f58e4b6f19
commit
55ba9b2811
@ -19,16 +19,11 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
|
|||||||
parser := luaparser.New()
|
parser := luaparser.New()
|
||||||
|
|
||||||
isAdmin := false
|
isAdmin := false
|
||||||
isDepositor := false
|
|
||||||
|
|
||||||
if nodename == "fancy_vend:admin_vendor" || nodename == "fancy_vend:admin_depo" {
|
if nodename == "fancy_vend:admin_vendor" || nodename == "fancy_vend:admin_depo" {
|
||||||
isAdmin = true
|
isAdmin = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if nodename == "fancy_vend:player_depo" || nodename == "fancy_vend:admin_depo" {
|
|
||||||
isDepositor = true
|
|
||||||
}
|
|
||||||
|
|
||||||
payInv := invMap["wanted_item"]
|
payInv := invMap["wanted_item"]
|
||||||
giveInv := invMap["given_item"]
|
giveInv := invMap["given_item"]
|
||||||
mainInv := invMap["main"]
|
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["owner"] = md["owner"]
|
||||||
o.Attributes["type"] = "fancyvend"
|
o.Attributes["type"] = "fancyvend"
|
||||||
|
|
||||||
if !isDepositor {
|
|
||||||
o.Attributes["in_item"] = in_item
|
o.Attributes["in_item"] = in_item
|
||||||
o.Attributes["in_count"] = strconv.Itoa(in_count)
|
o.Attributes["in_count"] = strconv.Itoa(in_count)
|
||||||
o.Attributes["out_item"] = out_item
|
o.Attributes["out_item"] = out_item
|
||||||
o.Attributes["out_count"] = strconv.Itoa(out_count)
|
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)
|
o.Attributes["stock"] = strconv.Itoa(stock_factor)
|
||||||
|
|
||||||
return o
|
return o
|
||||||
|
Loading…
Reference in New Issue
Block a user