diff --git a/src/games/stendhal/server/maps/quests/AbstractQuest.java b/src/games/stendhal/server/maps/quests/AbstractQuest.java index 825320fb4a..e60dd0f2b7 100644 --- a/src/games/stendhal/server/maps/quests/AbstractQuest.java +++ b/src/games/stendhal/server/maps/quests/AbstractQuest.java @@ -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; @@ -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