Account for unspecified durability, related to #65

This commit is contained in:
HappyPikachu 2017-07-24 11:35:03 -04:00
parent 8c858937d8
commit fef92e2b30
2 changed files with 17 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.9.5</version>
<version>2.9.6</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

View File

@ -627,12 +627,14 @@ public class CreateStagePrompt extends FixedSetPrompt {
}
if (one == two) {
int missing;
LinkedList<Integer> elements;
if (context.getSessionData(pref + CK.S_BREAK_DURABILITY) != null) {
missing = one - ((List<Integer>) context.getSessionData(pref + CK.S_BREAK_DURABILITY)).size();
elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_BREAK_DURABILITY);
} else {
missing = one;
elements = new LinkedList<Integer>();
}
LinkedList<Integer> elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_BREAK_DURABILITY);
for (int i = 0; i < missing; i++) {
elements.add(0);
}
@ -842,12 +844,14 @@ public class CreateStagePrompt extends FixedSetPrompt {
}
if (one == two) {
int missing;
LinkedList<Integer> elements;
if (context.getSessionData(pref + CK.S_DAMAGE_DURABILITY) != null) {
missing = one - ((List<Integer>) context.getSessionData(pref + CK.S_DAMAGE_DURABILITY)).size();
elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_DAMAGE_DURABILITY);
} else {
missing = one;
elements = new LinkedList<Integer>();
}
LinkedList<Integer> elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_DAMAGE_DURABILITY);
for (int i = 0; i < missing; i++) {
elements.add(0);
}
@ -1057,12 +1061,14 @@ public class CreateStagePrompt extends FixedSetPrompt {
}
if (one == two) {
int missing;
LinkedList<Integer> elements;
if (context.getSessionData(pref + CK.S_PLACE_DURABILITY) != null) {
missing = one - ((List<Integer>) context.getSessionData(pref + CK.S_PLACE_DURABILITY)).size();
elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_PLACE_DURABILITY);
} else {
missing = one;
elements = new LinkedList<Integer>();
}
LinkedList<Integer> elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_PLACE_DURABILITY);
for (int i = 0; i < missing; i++) {
elements.add(0);
}
@ -1272,12 +1278,14 @@ public class CreateStagePrompt extends FixedSetPrompt {
}
if (one == two) {
int missing;
LinkedList<Integer> elements;
if (context.getSessionData(pref + CK.S_USE_DURABILITY) != null) {
missing = one - ((List<Integer>) context.getSessionData(pref + CK.S_USE_DURABILITY)).size();
elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_DURABILITY);
} else {
missing = one;
elements = new LinkedList<Integer>();
}
LinkedList<Integer> elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_DURABILITY);
for (int i = 0; i < missing; i++) {
elements.add(0);
}
@ -1487,12 +1495,14 @@ public class CreateStagePrompt extends FixedSetPrompt {
}
if (one == two) {
int missing;
LinkedList<Integer> elements;
if (context.getSessionData(pref + CK.S_CUT_DURABILITY) != null) {
missing = one - ((List<Integer>) context.getSessionData(pref + CK.S_CUT_DURABILITY)).size();
elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_CUT_DURABILITY);
} else {
missing = one;
elements = new LinkedList<Integer>();
}
LinkedList<Integer> elements = (LinkedList<Integer>) context.getSessionData(pref + CK.S_CUT_DURABILITY);
for (int i = 0; i < missing; i++) {
elements.add(0);
}