mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
Simplify redundant conditional expressions
This commit is contained in:
parent
64a57b8bf9
commit
4b4496f99e
1 changed files with 3 additions and 3 deletions
|
|
@ -1512,7 +1512,7 @@ function fantasyMap() {
|
||||||
history = history.slice(0, historyStage);
|
history = history.slice(0, historyStage);
|
||||||
history[historyStage] = heights.slice();
|
history[historyStage] = heights.slice();
|
||||||
historyStage++;
|
historyStage++;
|
||||||
undo.disabled = templateUndo.disabled = historyStage > 1 ? false : true;
|
undo.disabled = templateUndo.disabled = historyStage <= 1;
|
||||||
redo.disabled = templateRedo.disabled = true;
|
redo.disabled = templateRedo.disabled = true;
|
||||||
const landMean = Math.trunc(d3.mean(heights));
|
const landMean = Math.trunc(d3.mean(heights));
|
||||||
const landRatio = rn(landCells / heights.length * 100);
|
const landRatio = rn(landCells / heights.length * 100);
|
||||||
|
|
@ -1526,8 +1526,8 @@ function fantasyMap() {
|
||||||
// restoreHistory
|
// restoreHistory
|
||||||
function restoreHistory(step) {
|
function restoreHistory(step) {
|
||||||
historyStage = step;
|
historyStage = step;
|
||||||
redo.disabled = templateRedo.disabled = historyStage < history.length ? false : true;
|
redo.disabled = templateRedo.disabled = historyStage >= history.length;
|
||||||
undo.disabled = templateUndo.disabled = historyStage > 1 ? false : true;
|
undo.disabled = templateUndo.disabled = historyStage <= 1;
|
||||||
if (history[historyStage - 1] === undefined) return;
|
if (history[historyStage - 1] === undefined) return;
|
||||||
heights = history[historyStage - 1].slice();
|
heights = history[historyStage - 1].slice();
|
||||||
updateHeightmap();
|
updateHeightmap();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue