1
0
Fork 0
forked from OpenNeo/impress

fix outfit loading only setting correct pet state on the first try

This commit is contained in:
Emi Matchu 2010-11-16 10:55:01 -05:00
parent 8403fdf888
commit 06c3150ad0
2 changed files with 6 additions and 2 deletions

View file

@ -695,7 +695,7 @@ View.PetStateForm = function (wardrobe) {
label.appendTo(li);
li.appendTo(ul);
}
updatePetState(wardrobe.outfit.pet_state);
updatePetState(wardrobe.outfit.getPetState());
}
});

View file

@ -745,8 +745,8 @@ function Wardrobe() {
function setFullOutfit(new_outfit) {
outfit = new_outfit;
controller.in_transaction = true;
controller.setPetTypeByColorAndSpecies(outfit.color_id, outfit.species_id);
controller.setPetStateById(outfit.pet_state_id);
controller.setPetTypeByColorAndSpecies(outfit.color_id, outfit.species_id);
controller.setClosetItemsByIds(outfit.getClosetItemIds());
controller.setWornItemsByIds(outfit.getWornItemIds());
controller.events.trigger('setOutfit', outfit);
@ -774,6 +774,10 @@ function Wardrobe() {
return outfit;
}
this.getPetState = function () {
return outfit.pet_state;
}
this.getPetType = function () {
return outfit.pet_type;
}