fixed cat bug both Player Name and I found at about the same time...
This commit is contained in:
parent
3a0db52215
commit
3559ab4d2f
@ -128,7 +128,12 @@ public final class FamiliarManager {
|
|||||||
}
|
}
|
||||||
if (currentPet != -1) {
|
if (currentPet != -1) {
|
||||||
int last = this.petDetails.get(currentPet).size() - 1;
|
int last = this.petDetails.get(currentPet).size() - 1;
|
||||||
PetDetails details = this.petDetails.get(currentPet).get(last);
|
PetDetails details;
|
||||||
|
if (last < 0) { //missing data in save due to historical bug (see GL !2077)
|
||||||
|
details = new PetDetails(0);
|
||||||
|
} else {
|
||||||
|
details = this.petDetails.get(currentPet).get(last);
|
||||||
|
}
|
||||||
Pets pets = Pets.forId(currentPet);
|
Pets pets = Pets.forId(currentPet);
|
||||||
familiar = new Pet(player, details, currentPet, pets.getNpcId(currentPet));
|
familiar = new Pet(player, details, currentPet, pets.getNpcId(currentPet));
|
||||||
} else if (familiarData.containsKey("familiar")) {
|
} else if (familiarData.containsKey("familiar")) {
|
||||||
@ -414,6 +419,9 @@ public final class FamiliarManager {
|
|||||||
* @param details The new pet details.
|
* @param details The new pet details.
|
||||||
*/
|
*/
|
||||||
public void addDetails(int itemId, PetDetails details) {
|
public void addDetails(int itemId, PetDetails details) {
|
||||||
|
if (petDetails.get(itemId) == null) {
|
||||||
|
petDetails.put(itemId, new ArrayList<>());
|
||||||
|
}
|
||||||
petDetails.get(itemId).add(details);
|
petDetails.get(itemId).add(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,8 +129,8 @@ public final class Pet extends Familiar {
|
|||||||
if (pet.isKitten(itemId)) {
|
if (pet.isKitten(itemId)) {
|
||||||
owner.incrementAttribute("/save:stats_manager:cats_raised");
|
owner.incrementAttribute("/save:stats_manager:cats_raised");
|
||||||
}
|
}
|
||||||
owner.getFamiliarManager().removeDetails(getItemId());
|
|
||||||
owner.getFamiliarManager().addDetails(newItemId, details);
|
owner.getFamiliarManager().addDetails(newItemId, details);
|
||||||
|
owner.getFamiliarManager().removeDetails(getItemId());
|
||||||
owner.getFamiliarManager().morphPet(new Item(newItemId), false, location, details.getHunger(), 0);
|
owner.getFamiliarManager().morphPet(new Item(newItemId), false, location, details.getHunger(), 0);
|
||||||
owner.getPacketDispatch().sendMessage("<col=ff0000>Your pet has grown larger.</col>");
|
owner.getPacketDispatch().sendMessage("<col=ff0000>Your pet has grown larger.</col>");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user