Spaces:
Running
Running
Upload 9 files
Browse files
src/utils/monsterUtils.js
CHANGED
|
@@ -450,7 +450,8 @@ export function getNextMonster(currentStage, likes, classSize, currentMonsterId
|
|
| 450 |
// Extract path suffix (e.g. "A" from "L1_A", "AB" from "L2_AB")
|
| 451 |
const currentPath = currentMonsterId.split('_')[1];
|
| 452 |
// Filter candidates: Must start with L{nextStage}_{currentPath}
|
| 453 |
-
|
|
|
|
| 454 |
|
| 455 |
if (strictMatches.length > 0) {
|
| 456 |
candidates = strictMatches;
|
|
|
|
| 450 |
// Extract path suffix (e.g. "A" from "L1_A", "AB" from "L2_AB")
|
| 451 |
const currentPath = currentMonsterId.split('_')[1];
|
| 452 |
// Filter candidates: Must start with L{nextStage}_{currentPath}
|
| 453 |
+
// FIXED: currentStage IS the target stage (e.g. 3), so we look for L3_...
|
| 454 |
+
const strictMatches = candidates.filter(m => m.id.startsWith(`L${currentStage}_${currentPath}`));
|
| 455 |
|
| 456 |
if (strictMatches.length > 0) {
|
| 457 |
candidates = strictMatches;
|