Compile fix try

This commit is contained in:
Aokromes committed 2017-01-18 15:09:57 +01:00
1 parent 0c97c46361
commit b7432bc39a
11 files changed
+63 -42

No files matched your search

@@ -2705,7 +2705,7 @@ Unit* Creature::SelectNearestHostileUnitInAggroRange(bool useLOS) const
void Creature::UpdateMovementFlags()
{
// Do not update movement flags if creature is controlled by a player (charm/vehicle)
if (m_movedPlayer)
if (m_playerMovingMe)
return;
// Set the movement flags if the creature is in that mode. (Only fly if actually in air, only swim if in water, etc)
+9 -9
View File
@@ -473,8 +473,8 @@ Player::Player(WorldSession* session): Unit(true)
// Player summoning
m_summon_expire = 0;
m_mover = this;
m_movedPlayer = this;
m_unitMovedByMe = this;
m_playerMovingMe = this;
m_seer = this;
@@ -22764,7 +22764,7 @@ bool Player::IsNeverVisible() const
bool Player::CanAlwaysSee(WorldObject const* obj) const
{
// Always can see self
if (m_mover == obj)
if (m_unitMovedByMe == obj)
return true;
if (ObjectGuid guid = GetGuidValue(PLAYER_FARSIGHT))
@@ -23063,10 +23063,10 @@ void Player::SendComboPoints()
if (combotarget)
{
WorldPacket data;
if (m_mover != this)
if (m_unitMovedByMe != this)
{
data.Initialize(SMSG_PET_UPDATE_COMBO_POINTS, m_mover->GetPackGUID().size()+combotarget->GetPackGUID().size()+1);
data << m_mover->GetPackGUID();
data.Initialize(SMSG_PET_UPDATE_COMBO_POINTS, m_unitMovedByMe->GetPackGUID().size()+combotarget->GetPackGUID().size()+1);
data << m_unitMovedByMe->GetPackGUID();
}
else
data.Initialize(SMSG_UPDATE_COMBO_POINTS, combotarget->GetPackGUID().size()+1);
@@ -24420,9 +24420,9 @@ void Player::SetClientControl(Unit* target, bool allowMove)
void Player::SetMover(Unit* target)
{
m_mover->m_movedPlayer = nullptr;
m_mover = target;
m_mover->m_movedPlayer = this;
m_unitMovedByMe->m_playerMovingMe = nullptr;
m_unitMovedByMe = target;
m_unitMovedByMe->m_playerMovingMe = this;
ObjectGuid guid = target->GetGUID();
+2 -1
View File
@@ -2296,7 +2296,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
/*** VARIOUS SYSTEMS ***/
/*********************************************************/
void UpdateFallInformationIfNeed(MovementInfo const& minfo, uint16 opcode);
Unit* m_mover;
// only changed for direct client control (possess, vehicle etc.), not stuff you control using pet commands
Unit* m_unitMovedByMe;
WorldObject* m_seer;
void SetFallInformation(uint32 time, float z);
void HandleFall(MovementInfo const& movementInfo);
+17 -3
View File
@@ -181,7 +181,7 @@ SpellSchoolMask ProcEventInfo::GetSchoolMask() const
}
Unit::Unit(bool isWorldObject) :
WorldObject(isWorldObject), m_movedPlayer(NULL), m_lastSanctuaryTime(0),
WorldObject(isWorldObject), m_playerMovingMe(NULL), m_lastSanctuaryTime(0),
IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(),
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0),
@@ -11369,7 +11369,7 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto
int32 Unit::CalcSpellDuration(SpellInfo const* spellProto)
{
uint8 comboPoints = m_movedPlayer ? m_movedPlayer->GetComboPoints() : 0;
uint8 comboPoints = m_playerMovingMe ? m_playerMovingMe->GetComboPoints() : 0;
int32 minduration = spellProto->GetDuration();
int32 maxduration = spellProto->GetMaxDuration();
@@ -12577,6 +12577,20 @@ void CharmInfo::SetSpellAutocast(SpellInfo const* spellInfo, bool state)
}
}
Unit* Unit::GetUnitBeingMoved() const
{
if (Player const* player = ToPlayer())
return player->m_unitMovedByMe;
return nullptr;
}
Player* Unit::GetPlayerBeingMoved() const
{
if (Unit* mover = GetUnitBeingMoved())
return mover->ToPlayer();
return nullptr;
}
bool Unit::isFrozen() const
{
return HasAuraState(AURA_STATE_FROZEN);
@@ -15154,7 +15168,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
if (Unit* charmer = GetCharmer())
{
player = charmer->ToPlayer();
if (player && player->m_mover != this)
if (player && player->m_unitMovedByMe != this)
player = NULL;
}
}
+8 -2
View File
@@ -1717,8 +1717,14 @@ class TC_GAME_API Unit : public WorldObject
CharmInfo* InitCharmInfo();
void DeleteCharmInfo();
void UpdateCharmAI();
//Player* GetMoverSource() const;
Player* m_movedPlayer;
// returns the unit that this player IS CONTROLLING
Unit* GetUnitBeingMoved() const;
// returns the player that this player IS CONTROLLING
Player* GetPlayerBeingMoved() const;
// returns the player that this unit is BEING CONTROLLED BY
Player* GetPlayerMovingMe() const { return m_playerMovingMe; }
// only set for direct client control (possess effects, vehicles and similar)
Player* m_playerMovingMe;
SharedVisionList const& GetSharedVisionList() { return m_sharedVision; }
void AddPlayerToVision(Player* player);
void RemovePlayerFromVision(Player* player);
+1 -1
View File
@@ -1713,7 +1713,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recvData)
MovementInfo movementInfo;
_player->ReadMovementInfo(recvData, &movementInfo);
_player->m_mover->m_movementInfo.flags = movementInfo.GetMovementFlags();
_player->m_unitMovedByMe->m_movementInfo.flags = movementInfo.GetMovementFlags();
}
void WorldSession::HandleRequestPetInfoOpcode(WorldPacket& /*recvData */)
+7 -7
View File
@@ -233,7 +233,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recvPacket)
TC_LOG_DEBUG("network", "Guid " UI64FMTD, uint64(guid));
TC_LOG_DEBUG("network", "Flags %u, time %u", flags, time/IN_MILLISECONDS);
Player* plMover = _player->m_mover->ToPlayer();
Player* plMover = _player->m_unitMovedByMe->ToPlayer();
if (!plMover || !plMover->IsBeingTeleportedNear())
return;
@@ -280,7 +280,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
{
uint16 opcode = recvPacket.GetOpcode();
Unit* mover = _player->m_mover;
Unit* mover = _player->m_unitMovedByMe;
ASSERT(mover != NULL); // there must always be a mover
@@ -536,8 +536,8 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvPacket)
recvPacket.ReadByteSeq(guid[7]);
if (GetPlayer()->IsInWorld())
if (_player->m_mover->GetGUID() != guid)
TC_LOG_DEBUG("network", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is %s and should be %s" , guid.ToString().c_str(), _player->m_mover->GetGUID().ToString().c_str());
if (_player->m_unitMovedByMe->GetGUID() != guid)
TC_LOG_DEBUG("network", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is %s and should be %s" , guid.ToString().c_str(), _player->m_unitMovedByMe->GetGUID().ToString().c_str());
}
void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData)
@@ -564,7 +564,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData)
MovementInfo movementInfo;
GetPlayer()->ReadMovementInfo(recvData, &movementInfo);
if (_player->m_mover->GetGUID() != movementInfo.guid)
if (_player->m_unitMovedByMe->GetGUID() != movementInfo.guid)
return;
_player->m_movementInfo = movementInfo;
@@ -578,8 +578,8 @@ void WorldSession::HandleGravityAckMessage(WorldPacket& recvData)
{
MovementInfo movementInfo;
GetPlayer()->ReadMovementInfo(recvData, &movementInfo);
if (movementInfo.guid != _player->m_mover->GetGUID())
TC_LOG_ERROR("network", "HandleGravityAckMessage: incorrect mover guid: mover is %s and should be %s.", movementInfo.guid.ToString().c_str(), _player->m_mover->GetGUID().ToString().c_str());
if (movementInfo.guid != _player->m_unitMovedByMe->GetGUID())
TC_LOG_ERROR("network", "HandleGravityAckMessage: incorrect mover guid: mover is %s and should be %s.", movementInfo.guid.ToString().c_str(), _player->m_unitMovedByMe->GetGUID().ToString().c_str());
}
+8 -8
View File
@@ -80,7 +80,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
Player* pUser = _player;
// ignore for remote control state
if (pUser->m_mover != pUser)
if (pUser->m_unitMovedByMe != pUser)
return;
uint8 bagIndex, slot, castFlags;
@@ -191,7 +191,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
Player* pUser = _player;
// ignore for remote control state
if (pUser->m_mover != pUser)
if (pUser->m_unitMovedByMe != pUser)
return;
uint8 bagIndex, slot;
@@ -290,8 +290,8 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData)
if (GameObject* obj = GetPlayer()->GetGameObjectIfCanInteractWith(guid))
{
// ignore for remote control state
if (GetPlayer()->m_mover != GetPlayer())
if (!(GetPlayer()->IsOnVehicle(GetPlayer()->m_mover) || GetPlayer()->IsMounted()) && !obj->GetGOInfo()->IsUsableMounted())
if (GetPlayer()->m_unitMovedByMe != GetPlayer())
if (!(GetPlayer()->IsOnVehicle(GetPlayer()->m_unitMovedByMe) || GetPlayer()->IsMounted()) && !obj->GetGOInfo()->IsUsableMounted())
return;
obj->Use(GetPlayer());
@@ -306,7 +306,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [%s]", guid.ToString().c_str());
// ignore for remote control state
if (_player->m_mover != _player)
if (_player->m_unitMovedByMe != _player)
return;
if (GameObject* go = GetPlayer()->GetGameObjectIfCanInteractWith(guid))
@@ -331,7 +331,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
TC_LOG_DEBUG("network", "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size());
// ignore for remote control state (for player case)
Unit* mover = _player->m_mover;
Unit* mover = _player->m_unitMovedByMe;
if (mover != _player && mover->GetTypeId() == TYPEID_PLAYER)
{
recvPacket.rfinish(); // prevent spam at ignore packet
@@ -527,7 +527,7 @@ void WorldSession::HandleCancelChanneling(WorldPacket& recvData)
recvData.read_skip<uint32>(); // spellid, not used
// ignore for remote control state (for player case)
Unit* mover = _player->m_mover;
Unit* mover = _player->m_unitMovedByMe;
if (mover != _player && mover->GetTypeId() == TYPEID_PLAYER)
return;
@@ -537,7 +537,7 @@ void WorldSession::HandleCancelChanneling(WorldPacket& recvData)
void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
{
// ignore for remote control state
if (_player->m_mover != _player)
if (_player->m_unitMovedByMe != _player)
return;
uint8 slotId;
+6 -6
View File
@@ -2959,7 +2959,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
// Set combo point requirement
if ((_triggeredCastFlags & TRIGGERED_IGNORE_COMBO_POINTS) || m_CastItem || !m_caster->m_movedPlayer)
if ((_triggeredCastFlags & TRIGGERED_IGNORE_COMBO_POINTS) || m_CastItem || !m_caster->m_playerMovingMe)
m_needComboPoints = false;
uint32 param1 = 0, param2 = 0;
@@ -3529,18 +3529,18 @@ void Spell::_handle_immediate_phase()
void Spell::_handle_finish_phase()
{
if (m_caster->m_movedPlayer)
if (m_caster->m_playerMovingMe)
{
// Take for real after all targets are processed
if (m_needComboPoints)
m_caster->m_movedPlayer->ClearComboPoints();
m_caster->m_playerMovingMe->ClearComboPoints();
// Real add combo points from effects
if (m_comboPointGain)
m_caster->m_movedPlayer->GainSpellComboPoints(m_comboPointGain);
m_caster->m_playerMovingMe->GainSpellComboPoints(m_comboPointGain);
if (m_spellInfo->PowerType == POWER_HOLY_POWER && m_caster->m_movedPlayer->getClass() == CLASS_PALADIN)
HandleHolyPower(m_caster->m_movedPlayer);
if (m_spellInfo->PowerType == POWER_HOLY_POWER && m_caster->m_playerMovingMe->getClass() == CLASS_PALADIN)
HandleHolyPower(m_caster->m_playerMovingMe);
}
if (m_caster->m_extraAttacks && m_spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
+2 -2
View File
@@ -3743,13 +3743,13 @@ void Spell::EffectAddComboPoints(SpellEffIndex /*effIndex*/)
if (!unitTarget)
return;
if (!m_caster->m_movedPlayer)
if (!m_caster->m_playerMovingMe)
return;
if (damage <= 0)
return;
m_caster->m_movedPlayer->AddComboPoints(unitTarget, damage, this);
m_caster->m_playerMovingMe->AddComboPoints(unitTarget, damage, this);
}
void Spell::EffectDuel(SpellEffIndex effIndex)
+2 -2
View File
@@ -505,8 +505,8 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
if (caster)
{
// bonus amount from combo points
if (caster->m_movedPlayer && comboDamage)
if (uint8 comboPoints = caster->m_movedPlayer->GetComboPoints())
if (caster->m_playerMovingMe && comboDamage)
if (uint8 comboPoints = caster->m_playerMovingMe->GetComboPoints())
value += comboDamage * comboPoints;
value = caster->ApplyEffectModifiers(_spellInfo, _effIndex, value);