*Fix possible exploits with flying paths.
--HG-- branch : trunk
This commit is contained in:
@@ -448,7 +448,8 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
|||||||
if (_player->isInFlight())
|
if (_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType());
|
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType());
|
||||||
|
|||||||
+13
-13
@@ -852,7 +852,7 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
|||||||
if (target->isInFlight())
|
if (target->isInFlight())
|
||||||
{
|
{
|
||||||
target->GetMotionMaster()->MovementExpired();
|
target->GetMotionMaster()->MovementExpired();
|
||||||
target->m_taxi.ClearTaxiDestinations();
|
target->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -988,7 +988,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
|||||||
if (_player->isInFlight())
|
if (_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -1021,7 +1021,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
|||||||
if (_player->isInFlight())
|
if (_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -1055,7 +1055,7 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
|||||||
if(target->isInFlight())
|
if(target->isInFlight())
|
||||||
{
|
{
|
||||||
target->GetMotionMaster()->MovementExpired();
|
target->GetMotionMaster()->MovementExpired();
|
||||||
target->m_taxi.ClearTaxiDestinations();
|
target->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
|
target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
|
||||||
@@ -2241,7 +2241,7 @@ bool ChatHandler::HandleTeleCommand(const char * args)
|
|||||||
if(_player->isInFlight())
|
if(_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2504,7 +2504,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args)
|
|||||||
if(target->isInFlight())
|
if(target->isInFlight())
|
||||||
{
|
{
|
||||||
target->GetMotionMaster()->MovementExpired();
|
target->GetMotionMaster()->MovementExpired();
|
||||||
target->m_taxi.ClearTaxiDestinations();
|
target->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2600,7 +2600,7 @@ bool ChatHandler::HandleTeleGroupCommand(const char * args)
|
|||||||
if(pl->isInFlight())
|
if(pl->isInFlight())
|
||||||
{
|
{
|
||||||
pl->GetMotionMaster()->MovementExpired();
|
pl->GetMotionMaster()->MovementExpired();
|
||||||
pl->m_taxi.ClearTaxiDestinations();
|
pl->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2689,7 +2689,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
|||||||
if(pl->isInFlight())
|
if(pl->isInFlight())
|
||||||
{
|
{
|
||||||
pl->GetMotionMaster()->MovementExpired();
|
pl->GetMotionMaster()->MovementExpired();
|
||||||
pl->m_taxi.ClearTaxiDestinations();
|
pl->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2739,7 +2739,7 @@ bool ChatHandler::HandleGoTaxinodeCommand(const char* args)
|
|||||||
if (_player->isInFlight())
|
if (_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2782,7 +2782,7 @@ bool ChatHandler::HandleGoXYCommand(const char* args)
|
|||||||
if(_player->isInFlight())
|
if(_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2832,7 +2832,7 @@ bool ChatHandler::HandleGoXYZCommand(const char* args)
|
|||||||
if(_player->isInFlight())
|
if(_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2903,7 +2903,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
|
|||||||
if(_player->isInFlight())
|
if(_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
@@ -2950,7 +2950,7 @@ bool ChatHandler::HandleGoGridCommand(const char* args)
|
|||||||
if(_player->isInFlight())
|
if(_player->isInFlight())
|
||||||
{
|
{
|
||||||
_player->GetMotionMaster()->MovementExpired();
|
_player->GetMotionMaster()->MovementExpired();
|
||||||
_player->m_taxi.ClearTaxiDestinations();
|
_player->CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
// save only in non-flight case
|
// save only in non-flight case
|
||||||
else
|
else
|
||||||
|
|||||||
+13
-1
@@ -17230,6 +17230,10 @@ void Player::RestoreSpellMods(Spell * spell)
|
|||||||
else
|
else
|
||||||
mod->charges++;
|
mod->charges++;
|
||||||
|
|
||||||
|
// Do not set more spellmods than avalible
|
||||||
|
if (mod->ownerAura->GetAuraCharges() < mod->charges)
|
||||||
|
mod->charges = mod->ownerAura->GetAuraCharges();
|
||||||
|
|
||||||
// Skip this check for now - aura charges may change due to various reason
|
// Skip this check for now - aura charges may change due to various reason
|
||||||
// TODO: trac these changes correctly
|
// TODO: trac these changes correctly
|
||||||
//assert (mod->ownerAura->GetAuraCharges() <= mod->charges);
|
//assert (mod->ownerAura->GetAuraCharges() <= mod->charges);
|
||||||
@@ -17656,6 +17660,14 @@ bool Player::ActivateTaxiPathTo( uint32 taxi_path_id, uint32 spellid /*= 0*/ )
|
|||||||
return ActivateTaxiPathTo(nodes,NULL,spellid);
|
return ActivateTaxiPathTo(nodes,NULL,spellid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::CleanupAfterTaxiFlight()
|
||||||
|
{
|
||||||
|
m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
|
||||||
|
Unmount();
|
||||||
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||||
|
getHostilRefManager().setOnlineOfflineState(true);
|
||||||
|
}
|
||||||
|
|
||||||
void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
|
void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
|
||||||
{
|
{
|
||||||
// last check 2.0.10
|
// last check 2.0.10
|
||||||
@@ -19366,7 +19378,7 @@ void Player::SummonIfPossible(bool agree)
|
|||||||
if(isInFlight())
|
if(isInFlight())
|
||||||
{
|
{
|
||||||
GetMotionMaster()->MovementExpired();
|
GetMotionMaster()->MovementExpired();
|
||||||
m_taxi.ClearTaxiDestinations();
|
CleanupAfterTaxiFlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
// drop flag at summon
|
// drop flag at summon
|
||||||
|
|||||||
@@ -905,6 +905,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
|||||||
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
|
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
|
||||||
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = NULL, uint32 spellid = 0);
|
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = NULL, uint32 spellid = 0);
|
||||||
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 0);
|
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 0);
|
||||||
|
void CleanupAfterTaxiFlight();
|
||||||
// mount_id can be used in scripting calls
|
// mount_id can be used in scripting calls
|
||||||
bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||||
void SetAcceptWhispers(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
void SetAcceptWhispers(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||||
|
|||||||
+2
-1
@@ -3278,8 +3278,9 @@ void Spell::finish(bool ok)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// potions disabled by client, send event "not in combat" if need
|
// potions disabled by client, send event "not in combat" if need
|
||||||
if (!m_triggeredByAuraSpell && m_caster->GetTypeId() == TYPEID_PLAYER)
|
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
|
if (!m_triggeredByAuraSpell)
|
||||||
((Player*)m_caster)->UpdatePotionCooldown(this);
|
((Player*)m_caster)->UpdatePotionCooldown(this);
|
||||||
|
|
||||||
// triggered spell pointer can be not set in some cases
|
// triggered spell pointer can be not set in some cases
|
||||||
|
|||||||
@@ -256,11 +256,8 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& /*recv_data*/)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetPlayer()->m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
|
GetPlayer()->CleanupAfterTaxiFlight();
|
||||||
GetPlayer()->Unmount();
|
|
||||||
GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
|
||||||
GetPlayer()->SetFallInformation(0, GetPlayer()->GetPositionZ());
|
GetPlayer()->SetFallInformation(0, GetPlayer()->GetPositionZ());
|
||||||
GetPlayer()->getHostilRefManager().setOnlineOfflineState(true);
|
|
||||||
if(GetPlayer()->pvpInfo.inHostileArea)
|
if(GetPlayer()->pvpInfo.inHostileArea)
|
||||||
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
|
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user