shop fixes
This commit is contained in:
parent
f65dde7713
commit
b32b45e725
@ -5,6 +5,7 @@ import (
|
|||||||
"mapserver/mapblockparser"
|
"mapserver/mapblockparser"
|
||||||
"mapserver/mapobjectdb"
|
"mapserver/mapobjectdb"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -26,6 +27,14 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
|
|||||||
giveInv := invMap["given_item"]
|
giveInv := invMap["given_item"]
|
||||||
mainInv := invMap["main"]
|
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() {
|
if payInv.Items[0].IsEmpty() || giveInv.Items[0].IsEmpty() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -33,10 +42,10 @@ func (this *FancyVend) onMapObject(x, y, z int, block *mapblockparser.MapBlock)
|
|||||||
settings, err := parser.ParseMap(md["settings"])
|
settings, err := parser.ParseMap(md["settings"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fields := logrus.Fields{
|
fields := logrus.Fields{
|
||||||
"x": x,
|
"x": x,
|
||||||
"y": y,
|
"y": y,
|
||||||
"z": z,
|
"z": z,
|
||||||
"pos": block.Pos,
|
"pos": block.Pos,
|
||||||
"err": err,
|
"err": err,
|
||||||
}
|
}
|
||||||
log.WithFields(fields).Error("Fancyvend setting error")
|
log.WithFields(fields).Error("Fancyvend setting error")
|
||||||
@ -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 := mapobjectdb.NewMapObject(block.Pos, x, y, z, "shop")
|
||||||
o.Attributes["owner"] = md["owner"]
|
o.Attributes["owner"] = md["owner"]
|
||||||
|
o.Attributes["type"] = md["fancyvend"]
|
||||||
|
|
||||||
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)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var TechnicQuarryIcon = L.icon({
|
var TechnicQuarryIcon = L.icon({
|
||||||
iconUrl: 'pics/default_tool_mesepick.png.png',
|
iconUrl: 'pics/default_tool_mesepick.png',
|
||||||
|
|
||||||
iconSize: [16, 16],
|
iconSize: [16, 16],
|
||||||
iconAnchor: [8, 8],
|
iconAnchor: [8, 8],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var TechnicSwitchIcon = L.icon({
|
var TechnicSwitchIcon = L.icon({
|
||||||
iconUrl: 'pics/technic_water_mill_top_active.png.png',
|
iconUrl: 'pics/technic_water_mill_top_active.png',
|
||||||
|
|
||||||
iconSize: [16, 16],
|
iconSize: [16, 16],
|
||||||
iconAnchor: [8, 8],
|
iconAnchor: [8, 8],
|
||||||
@ -10,7 +10,7 @@ var TechnicSwitchIcon = L.icon({
|
|||||||
|
|
||||||
var TechnicSwitchOverlay = AbstractIconOverlay.extend({
|
var TechnicSwitchOverlay = AbstractIconOverlay.extend({
|
||||||
initialize: function(wsChannel, layerMgr) {
|
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){
|
createPopup: function(sw){
|
||||||
|
Loading…
Reference in New Issue
Block a user