aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclick <none@none>2010-10-10 01:03:21 +0200
committerclick <none@none>2010-10-10 01:03:21 +0200
commit0509a780c8ea7e30e10d82de5bd10e525adb89d5 (patch)
tree649c11444664ddc1cfd4c4caf170d18abc0cea03
parent64ccaa6c08f801883763afafb7590008eea166fa (diff)
Core/Entities: Ensure that pets retain their XP-points when dismissed in any form or way (outrunning/riding/mounting/flying)
Also clean up the logic a bit - pet stats initialization initializes hp/mana/powers on pets, while they should only be initialized/changed on pet call/creation. Fixes issues 4284 --HG-- branch : trunk
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp8
-rwxr-xr-xsrc/server/shared/Common.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index aa26d788316..5e1843404b9 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -228,18 +228,17 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
}
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped here
- SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32());
SetCreatorGUID(owner->GetGUID());
+ SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32());
+ SynchronizeLevelWithOwner();
SetReactState(ReactStates(fields[6].GetUInt8()));
SetCanModifyStats(true);
- SynchronizeLevelWithOwner();
- InitStatsForLevel(petlevel);
if (getPetType() == SUMMON_PET && !current) //all (?) summon pets come with full health when called, but not when they are current
{
- SetFullHealth();
+ InitStatsForLevel(petlevel);
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
}
else
@@ -1197,7 +1196,6 @@ void Pet::_SaveSpells(SQLTransaction& trans)
case PETSPELL_UNCHANGED:
continue;
}
-
itr->second.state = PETSPELL_UNCHANGED;
}
}
diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h
index 48ec5d4eb6d..e369583f007 100755
--- a/src/server/shared/Common.h
+++ b/src/server/shared/Common.h
@@ -48,7 +48,7 @@
#undef VERSION
#endif //VERSION
-# include "config.h"
+# include "Config.h"
#undef PACKAGE
#undef PACKAGE_BUGREPORT