From 01b57a480ef14545f1c0e269a68986c4af0c8c9d Mon Sep 17 00:00:00 2001 From: Nuno Date: Mon, 8 May 2023 21:45:46 +0200 Subject: [PATCH] Fix --- .../server/src/entities_game_service/player_manager/character.cpp | 7 +++++-- ryzom/server/src/entities_game_service/player_manager/character.h | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ryzom/server/src/entities_game_service/player_manager/character.cpp b/ryzom/server/src/entities_game_service/player_manager/character.cpp index b7b53df05..fe8c4f8f3 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -6030,7 +6030,7 @@ void CCharacter::setCurrentContinent(CONTINENT::TContinent continent) //----------------------------------------------- // CCharacter::addCharacterAnimal buy a creature //----------------------------------------------- -bool CCharacter::addCharacterAnimal(const CSheetId &PetTicket, uint32 Price, CGameItemPtr ptr, uint8 size, const ucstring &customName) +bool CCharacter::addCharacterAnimal(const CSheetId &PetTicket, uint32 Price, CGameItemPtr ptr, uint8 size, const ucstring &customName, const string &clientSheet) { if (!PackAnimalSystemEnabled) return false; @@ -6046,7 +6046,10 @@ bool CCharacter::addCharacterAnimal(const CSheetId &PetTicket, uint32 Price, CGa if (checkAnimalCount(PetTicket, true, 1)) { const CStaticItem* form = CSheets::getForm(PetTicket); - pet.PetSheetId = form->PetSheet; + if (!clientSheet.empty()) + pet.PetSheetId = CSheetId(clientSheet.c_str()); + else + pet.PetSheetId = form->PetSheet; pet.Satiety = form->PetHungerCount; pet.MaxSatiety = form->PetHungerCount; uint8 startSlot = 0; diff --git a/ryzom/server/src/entities_game_service/player_manager/character.h b/ryzom/server/src/entities_game_service/player_manager/character.h index 187169e13..bfbcb4b33 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character.h +++ b/ryzom/server/src/entities_game_service/player_manager/character.h @@ -988,7 +988,7 @@ public: void setTimeOfDeath(NLMISC::TGameTime t); // character buy a creature - bool addCharacterAnimal(const NLMISC::CSheetId &PetTicket, uint32 Price, CGameItemPtr ptr, uint8 size = 100, const ucstring &customName = ucstring("")); + bool addCharacterAnimal(const NLMISC::CSheetId &PetTicket, uint32 Price, CGameItemPtr ptr, uint8 size = 100, const ucstring &customName = ucstring(""), const std::string &clientSheet = ""); // return free slot for pet spawn or -1 if there are no free slot sint32 getFreePetSlot(uint8 startSlot = 0); @@ -3024,6 +3024,9 @@ public: return (_EntityState.X() != _OldPosX || _EntityState.Y() != _OldPosY); } + /// apply regenerate and clip currents value + void applyRegenAndClipCurrentValue(); + /// Kill the player void killMe(); @@ -3079,9 +3082,6 @@ private: /// recompute all Max value void computeMaxValue(); - /// apply regenerate and clip currents value - void applyRegenAndClipCurrentValue(); - /// character is dead void deathOccurs(void); -- 2.11.4.GIT