Skip to content

Commit

Permalink
Fix parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed May 29, 2024
1 parent 6723d7f commit 7113c11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/games/stendhal/server/maps/quests/AbstractQuest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.List;

import games.stendhal.common.MathHelper;
import games.stendhal.server.core.engine.SingletonRepository;
import games.stendhal.server.entity.npc.NPCList;
import games.stendhal.server.entity.player.Player;
Expand Down Expand Up @@ -159,7 +160,7 @@ public int getCompletedCount(final Player player) {
stateIndex = completionsIndexes.first();
}
if (stateIndex != null && state.length > stateIndex && !"".equals(state[stateIndex])) {
return Integer.parseInt(state[stateIndex]);
return MathHelper.parseIntDefault(state[stateIndex], completed ? 1 : 0);
}
}
// default is to return 1 if quest is in complete state and 0 otherwise
Expand Down

0 comments on commit 7113c11

Please sign in to comment.