[7644] Fixed pet slot values using in pet save.

Problem exist from client version switch when stable slot amount changed.
In result this has been source problems with stable use (3-4 slots) and possible pet lost in some cases
or "not save state" for summoned pets.
Use enums to avoid repeating problem, use more safe value for not-in-slot save (for summoned pets)
Fixed data preparing for MSG_LIST_STABLED_PETS.
This commit is contained in:
VladimirMangos 2009-04-10 04:49:39 +04:00
parent 34d69bbfdd
commit 263bf2ab22
9 changed files with 142 additions and 124 deletions

View file

@ -34,13 +34,16 @@ enum PetType
extern char const* petTypeSuffix[MAX_PET_TYPE];
#define MAX_PET_STABLES 4
// stored in character_pet.slot
enum PetSaveMode
{
PET_SAVE_AS_DELETED =-1,
PET_SAVE_AS_CURRENT = 0,
PET_SAVE_IN_STABLE_SLOT_1 = 1,
PET_SAVE_IN_STABLE_SLOT_2 = 2,
PET_SAVE_NOT_IN_SLOT = 3
PET_SAVE_AS_DELETED = -1, // not saved in fact
PET_SAVE_AS_CURRENT = 0, // in current slot (with player)
PET_SAVE_FIRST_STABLE_SLOT = 1,
PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100
};
enum HappinessState