Fix map grid detection

This commit is contained in:
Mitchell McCaffrey 2021-01-20 18:55:42 +11:00
parent 7583817f6a
commit b2b6f281a9

View File

@ -127,7 +127,7 @@ function SelectMapModal({
return new Promise((resolve, reject) => {
image.onload = async function () {
// Find name and grid size
let gridSize = { x: 22, y: 22 };
let gridSize;
let name = "Unknown Map";
if (file.name) {
if (file.name.matchAll) {
@ -162,6 +162,10 @@ function SelectMapModal({
name = Case.capital(name);
}
if (!gridSize) {
gridSize = { x: 22, y: 22 };
}
// Create resolutions
const resolutions = {};
for (let resolution of mapResolutions) {