shop fixes

This commit is contained in:
Thomas Rudin 2019-02-23 17:07:53 +01:00
parent f65dde7713
commit b32b45e725
3 changed files with 17 additions and 7 deletions

View File

@ -5,6 +5,7 @@ import (
"mapserver/mapblockparser"
"mapserver/mapobjectdb"
"strconv"
"github.com/sirupsen/logrus"
)
@ -26,6 +27,14 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
giveInv := invMap["given_item"]
mainInv := invMap["main"]
if payInv == nil || giveInv == nil {
return nil
}
if payInv.Items == nil || giveInv.Items == nil {
return nil
}
if payInv.Items[0].IsEmpty() || giveInv.Items[0].IsEmpty() {
return nil
}
@ -76,6 +85,7 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
o := mapobjectdb.NewMapObject(block.Pos, x, y, z, "shop")
o.Attributes["owner"] = md["owner"]
o.Attributes["type"] = md["fancyvend"]
o.Attributes["in_item"] = in_item
o.Attributes["in_count"] = strconv.Itoa(in_count)

View File

@ -1,7 +1,7 @@
'use strict';
var TechnicQuarryIcon = L.icon({
iconUrl: 'pics/default_tool_mesepick.png.png',
iconUrl: 'pics/default_tool_mesepick.png',
iconSize: [16, 16],
iconAnchor: [8, 8],

View File

@ -1,7 +1,7 @@
'use strict';
var TechnicSwitchIcon = L.icon({
iconUrl: 'pics/technic_water_mill_top_active.png.png',
iconUrl: 'pics/technic_water_mill_top_active.png',
iconSize: [16, 16],
iconAnchor: [8, 8],
@ -10,7 +10,7 @@ var TechnicSwitchIcon = L.icon({
var TechnicSwitchOverlay = AbstractIconOverlay.extend({
initialize: function(wsChannel, layerMgr) {
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "technicswitch", TechnicQuarryIcon);
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "technicswitch", TechnicSwitchIcon);
},
createPopup: function(sw){