mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-12 20:34:36 +01:00
Fix monolith crash at floor 20
This commit is contained in:
@@ -228,7 +228,7 @@ public class StarTowerGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int levelUp(int picks) {
|
public int levelUp(int picks) {
|
||||||
if (this.teamExp >= this.nextLevelExp) {
|
if (this.teamExp >= this.nextLevelExp && this.nextLevelExp != Integer.MAX_VALUE) {
|
||||||
// Level up
|
// Level up
|
||||||
this.teamLevel++;
|
this.teamLevel++;
|
||||||
|
|
||||||
@@ -238,8 +238,13 @@ public class StarTowerGame {
|
|||||||
// Subtract target exp
|
// Subtract target exp
|
||||||
this.teamExp = this.teamExp - this.nextLevelExp;
|
this.teamExp = this.teamExp - this.nextLevelExp;
|
||||||
|
|
||||||
// Update next level exp
|
// Update next level exp
|
||||||
this.nextLevelExp = GameData.getStarTowerTeamExpDataTable().get(this.teamLevel + 1).getNeedExp();
|
var teamExpData = GameData.getStarTowerTeamExpDataTable().get(this.teamLevel + 1);
|
||||||
|
if (teamExpData != null) {
|
||||||
|
this.nextLevelExp = teamExpData.getNeedExp();
|
||||||
|
} else {
|
||||||
|
this.nextLevelExp = Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
// Re-check and continue processing if we still got exp
|
// Re-check and continue processing if we still got exp
|
||||||
if (this.teamExp > 0) {
|
if (this.teamExp > 0) {
|
||||||
@@ -670,9 +675,9 @@ public class StarTowerGame {
|
|||||||
var hawkerCase = new StarTowerCase(CaseType.Hawker);
|
var hawkerCase = new StarTowerCase(CaseType.Hawker);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
hawkerCase.addGoods(new StarTowerShopGoods(1, 1, 200));
|
for (int i = 0; i < 8; i++) {
|
||||||
hawkerCase.addGoods(new StarTowerShopGoods(1, 1, 200));
|
hawkerCase.addGoods(new StarTowerShopGoods(1, 1, 200));
|
||||||
hawkerCase.addGoods(new StarTowerShopGoods(1, 1, 200));
|
}
|
||||||
|
|
||||||
this.addCase(room.getMutableCases(), hawkerCase);
|
this.addCase(room.getMutableCases(), hawkerCase);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user