This commit is contained in:
Azgaar 2019-09-13 00:04:27 +03:00
parent a3256e6726
commit 6aec843b47
2 changed files with 4 additions and 3 deletions

View file

@ -1520,7 +1520,7 @@
<input id="mapName" data-stored="mapName" class="long" autocorrect="off" spellcheck="false" type="text">
</td>
<td>
<i data-tip="Regenerate map name" onclick="Names.getMapName()" class="icon-arrows-cw"></i>
<i data-tip="Regenerate map name" onclick="Names.getMapName(true)" class="icon-arrows-cw"></i>
</td>
</tr>

View file

@ -169,8 +169,9 @@
}
// generato name for the map
const getMapName = function() {
if (locked("mapName")) return;
const getMapName = function(force) {
if (!force && locked("mapName")) return;
if (force && locked("mapName")) unlock("mapName");
const base = Math.random() < .7 ? 2 : Math.random() < .5 ? rand(0, 6) : rand(0, 31);
if (!nameBases[base]) {tip("Namebase is not found", false, "error"); return ""};
const min = nameBases[base].min-1;