Fix _export
This commit is contained in:
parent
ef816bce1f
commit
06a28348f9
@ -214,6 +214,9 @@ maps.prototype.load = function (data, floorId) {
|
||||
////// 将当前地图重新变成二维数组形式 //////
|
||||
maps.prototype.getMapArray = function (blockArray,width,height){
|
||||
|
||||
width=width||13;
|
||||
height=height||13;
|
||||
|
||||
var blocks = [];
|
||||
for (var x=0;x<height;x++) {
|
||||
blocks[x]=[];
|
||||
@ -222,7 +225,7 @@ maps.prototype.getMapArray = function (blockArray,width,height){
|
||||
}
|
||||
}
|
||||
blockArray.forEach(function (block) {
|
||||
if (!block.disable)
|
||||
if (!block.disable && block.x<width && block.y<height)
|
||||
blocks[block.y][block.x] = block.id;
|
||||
});
|
||||
return blocks;
|
||||
|
||||
@ -693,7 +693,7 @@ utils.prototype._export = function (floorIds) {
|
||||
// map
|
||||
var content = floorIds.length+"\n13 13\n\n";
|
||||
floorIds.forEach(function (floorId) {
|
||||
var arr = core.maps.getMapArray(core.status.maps[floorId].blocks);
|
||||
var arr = core.maps.getMapArray(core.status.maps[floorId].blocks, 13, 13);
|
||||
content += arr.map(function (x) {
|
||||
// check monster
|
||||
x.forEach(function (t) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user