Fixed bug where ultimate ironmen could have rewards sent to bank

Fixed the allquest command on new accounts on first login
This commit is contained in:
Player Name
2025-01-20 13:52:46 +00:00
committed by Ryan
parent 9af776e3c6
commit a932c309b3
3 changed files with 34 additions and 18 deletions
@@ -69,19 +69,19 @@ public final class FamiliarManager {
}
public void parse(JSONObject familiarData) {
for (Pets pet : Pets.values()) {
for (int id : new int[]{pet.getBabyItemId(), pet.getGrownItemId(), pet.getOvergrownItemId()}) {
if (id != -1) {
petDetails.put(id, new ArrayList<PetDetails>());
}
}
}
int currentPet = -1;
if (familiarData.containsKey("currentPet")) {
currentPet = Integer.parseInt(familiarData.get("currentPet").toString());
}
if (player.version < 2) { //migrate the v1 format
for (Pets pet : Pets.values()) {
for (int id : new int[]{pet.getBabyItemId(), pet.getGrownItemId(), pet.getOvergrownItemId()}) {
if (id != -1) {
petDetails.put(id, new ArrayList<PetDetails>());
}
}
}
JSONArray petDetails = (JSONArray) familiarData.get("petDetails");
for (Object petDetail : petDetails) {
JSONObject detail = (JSONObject) petDetail;
@@ -267,6 +267,9 @@ public final class FamiliarManager {
player.getDialogueInterpreter().sendDialogue("You need a summoning level of " + pets.getSummoningLevel() + " to summon this.");
return false;
}
if (!this.petDetails.containsKey(itemId)) {
petDetails.put(itemId, new ArrayList<PetDetails>());
}
int last = this.petDetails.get(itemId).size() - 1;
if (last < 0) { //new pet
last = 0;