]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tracker/Map.js
better dungeon cleared check
[alttp.git] / resources / js / components / tracker / Map.js
index 9c27a3476ff938d7ce4a56be9ae642d67e00c7df..b2685f873d6776814e00db66ff2cc6c225d51b03 100644 (file)
@@ -7,6 +7,7 @@ import {
        decrement,
        hasDungeonBoss,
        increment,
+       isDungeonCleared,
        toggleBoolean,
        unclearAll,
 } from '../../helpers/tracker';
@@ -684,14 +685,8 @@ const Map = () => {
                const cleared = state[`${dungeon.id}-checks`] || 0;
                const total = definition.items;
                let status = 'available';
-               if (cleared === total) {
-                       if (['ct', 'gt'].includes(dungeon.id)) {
-                               if (hasDungeonBoss(state, dungeon)) {
-                                       status = 'cleared';
-                               }
-                       } else {
-                               status = 'cleared';
-                       }
+               if (isDungeonCleared(state, definition)) {
+                       status = 'cleared';
                }
                return {
                        ...dungeon,