Fixes a bug for random maps where Map.validT didn't apply the distance parameter properly on rectangular maps. Fixes #4012

This was SVN commit r18312.
This commit is contained in:
FeXoR 2016-06-03 15:29:28 +00:00
parent 3cf766126b
commit 0bf90da597

View File

@ -102,7 +102,7 @@ Map.prototype.validT = function(x, z, distance)
}
else
// Within map square
return x >= 0 && z >= 0 && x < this.size && z < this.size;
return x >= distance && z >= distance && x < this.size - distance && z < this.size - distance;
};
// Check bounds on tile map