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){
|
maps.prototype.getMapArray = function (blockArray,width,height){
|
||||||
|
|
||||||
|
width=width||13;
|
||||||
|
height=height||13;
|
||||||
|
|
||||||
var blocks = [];
|
var blocks = [];
|
||||||
for (var x=0;x<height;x++) {
|
for (var x=0;x<height;x++) {
|
||||||
blocks[x]=[];
|
blocks[x]=[];
|
||||||
@ -222,7 +225,7 @@ maps.prototype.getMapArray = function (blockArray,width,height){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
blockArray.forEach(function (block) {
|
blockArray.forEach(function (block) {
|
||||||
if (!block.disable)
|
if (!block.disable && block.x<width && block.y<height)
|
||||||
blocks[block.y][block.x] = block.id;
|
blocks[block.y][block.x] = block.id;
|
||||||
});
|
});
|
||||||
return blocks;
|
return blocks;
|
||||||
|
|||||||
@ -693,7 +693,7 @@ utils.prototype._export = function (floorIds) {
|
|||||||
// map
|
// map
|
||||||
var content = floorIds.length+"\n13 13\n\n";
|
var content = floorIds.length+"\n13 13\n\n";
|
||||||
floorIds.forEach(function (floorId) {
|
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) {
|
content += arr.map(function (x) {
|
||||||
// check monster
|
// check monster
|
||||||
x.forEach(function (t) {
|
x.forEach(function (t) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user