[11457] Use ObjectGuid way work with PLAYER_DUEL_ARBITER.

This commit is contained in:
VladimirMangos 2011-05-09 20:28:20 +04:00
parent 7318bb0864
commit 1d781cd431
3 changed files with 17 additions and 22 deletions

View file

@ -1765,11 +1765,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// We have to perform this check before the teleport, otherwise the
// ObjectAccessor won't find the flag.
if (duel && GetMapId() != mapid)
{
GameObject* obj = GetMap()->GetGameObject(GetUInt64Value(PLAYER_DUEL_ARBITER));
if (obj)
if (GameObject* obj = GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER)))
DuelComplete(DUEL_FLED);
}
// reset movement flags at teleport, because player will continue move with these flags after teleport
m_movementInfo.SetMovementFlags(MOVEFLAG_NONE);
@ -6897,8 +6894,7 @@ void Player::CheckDuelDistance(time_t currTime)
if (!duel)
return;
uint64 duelFlagGUID = GetUInt64Value(PLAYER_DUEL_ARBITER);
GameObject* obj = GetMap()->GetGameObject(duelFlagGUID);
GameObject* obj = GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER));
if(!obj)
return;
@ -6956,8 +6952,7 @@ void Player::DuelComplete(DuelCompleteType type)
}
//Remove Duel Flag object
GameObject* obj = GetMap()->GetGameObject(GetUInt64Value(PLAYER_DUEL_ARBITER));
if(obj)
if (GameObject* obj = GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER)))
duel->initiator->RemoveGameObject(obj, true);
/* remove auras */
@ -6994,9 +6989,9 @@ void Player::DuelComplete(DuelCompleteType type)
duel->opponent->ClearComboPoints();
//cleanups
SetUInt64Value(PLAYER_DUEL_ARBITER, 0);
SetGuidValue(PLAYER_DUEL_ARBITER, ObjectGuid());
SetUInt32Value(PLAYER_DUEL_TEAM, 0);
duel->opponent->SetUInt64Value(PLAYER_DUEL_ARBITER, 0);
duel->opponent->SetGuidValue(PLAYER_DUEL_ARBITER, ObjectGuid());
duel->opponent->SetUInt32Value(PLAYER_DUEL_TEAM, 0);
delete duel->opponent->duel;
@ -15670,7 +15665,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder *holder )
ClearInCombat();
// make sure the unit is considered not in duel for proper loading
SetUInt64Value(PLAYER_DUEL_ARBITER, 0);
SetGuidValue(PLAYER_DUEL_ARBITER, ObjectGuid());
SetUInt32Value(PLAYER_DUEL_TEAM, 0);
// reset stats before loading any modifiers

View file

@ -7765,8 +7765,8 @@ void Spell::EffectDuel(SpellEffectIndex eff_idx)
duel2->startTimer = 0;
target->duel = duel2;
caster->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
target->SetUInt64Value(PLAYER_DUEL_ARBITER, pGameObj->GetGUID());
caster->SetGuidValue(PLAYER_DUEL_ARBITER, pGameObj->GetObjectGuid());
target->SetGuidValue(PLAYER_DUEL_ARBITER, pGameObj->GetObjectGuid());
}
void Spell::EffectStuck(SpellEffectIndex /*eff_idx*/)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11456"
#define REVISION_NR "11457"
#endif // __REVISION_NR_H__