Validate max-level equipment exp
This commit is contained in:
@@ -117,6 +117,8 @@ function validateUnitEquipment(errors, unitEntries, itemCatalog, itemKeys, equip
|
||||
errors.push(`${context}: invalid ${slot} exp ${state.exp}`);
|
||||
} else if (state.level < 9 && state.exp >= equipmentExpToNext(state.level)) {
|
||||
errors.push(`${context}: ${slot} exp ${state.exp} should be below next level threshold ${equipmentExpToNext(state.level)}`);
|
||||
} else if (state.level >= 9 && state.exp > equipmentExpToNext(state.level)) {
|
||||
errors.push(`${context}: max-level ${slot} exp ${state.exp} should be at most ${equipmentExpToNext(state.level)}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user