aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-11 14:47:38 -0500
committermegamage <none@none>2009-04-11 14:47:38 -0500
commit3120221deb93af2125a9baefe745cbbab8426ffe (patch)
tree6ebfc7364a8fc73eb234074d33477fbfe3fe08b6 /src/game/Unit.cpp
parentf4d69d1b3b8fe6d26195b14f0ec2133b872c735c (diff)
*Note: this patch may do not have any use for TC.
[7645] Fixed problems wit temporary unsummoned pets and cleanup code. Author: VladimirMangos * Save temporary unsummoned pet to current slot (instead non_in_slot mode) and prevent save as current pet summoned while temporay unsummon (arena) * Prevent overwrite temporary summoned pet data * At player loading set temporary unsummoned pet data instead pet loading if pet expected to be temporary unsummoned in current player state (loading in taxi flight/etc) * Restore proper pet at arena leave and unsummon in arena summoned. --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 88155b4be51..4932887d2d9 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9537,21 +9537,7 @@ void Unit::Mount(uint32 mount)
// unsummon pet
if(GetTypeId() == TYPEID_PLAYER)
- {
- Pet* pet = ((Player*)this)->GetPet();
- if(pet)
- {
- if(pet->isControlled())
- {
- ((Player*)this)->SetTemporaryUnsummonedPetNumber(pet->GetCharmInfo()->GetPetNumber());
- ((Player*)this)->SetOldPetSpell(pet->GetUInt32Value(UNIT_CREATED_BY_SPELL));
- }
-
- ((Player*)this)->RemovePet(NULL,PET_SAVE_NOT_IN_SLOT);
- }
- else
- ((Player*)this)->SetTemporaryUnsummonedPetNumber(0);
- }
+ ((Player*)this)->UnsummonPetTemporaryIfAny();
}
void Unit::Unmount()
@@ -9567,6 +9553,7 @@ void Unit::Unmount()
// only resummon old pet if the player is already added to a map
// this prevents adding a pet to a not created map which would otherwise cause a crash
// (it could probably happen when logging in after a previous crash)
+<<<<<<< HEAD:src/game/Unit.cpp
if(GetTypeId() == TYPEID_PLAYER && IsInWorld() && ((Player*)this)->GetTemporaryUnsummonedPetNumber() && isAlive())
{
Pet* NewPet = new Pet((Player*)this);
@@ -9575,6 +9562,10 @@ void Unit::Unmount()
((Player*)this)->SetTemporaryUnsummonedPetNumber(0);
}
+=======
+ if(GetTypeId() == TYPEID_PLAYER)
+ ((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();
+>>>>>>> 661760f287d94dbbe8f5224b19ba4181c7d62910:src/game/Unit.cpp
}
void Unit::SetInCombatWith(Unit* enemy)