mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
fix(Core/Vehicle): Fix invisible vehicle passengers (#23406)
This commit is contained in:
@@ -417,6 +417,8 @@ Player::Player(WorldSession* session): Unit(), m_mover(this)
|
||||
GetObjectVisibilityContainer().InitForPlayer();
|
||||
|
||||
sScriptMgr->OnConstructPlayer(this);
|
||||
|
||||
m_expectingChangeTransport = false;
|
||||
}
|
||||
|
||||
Player::~Player()
|
||||
|
||||
@@ -2633,6 +2633,9 @@ public:
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
bool IsExpectingChangeTransport() const { return m_expectingChangeTransport; }
|
||||
void SetExpectingChangeTransport(bool state) { m_expectingChangeTransport = state; }
|
||||
|
||||
/*********************************************************/
|
||||
/*** SPELL QUEUE SYSTEM ***/
|
||||
/*********************************************************/
|
||||
@@ -3013,6 +3016,8 @@ private:
|
||||
PlayerSettingMap m_charSettingsMap;
|
||||
|
||||
Seconds m_creationTime;
|
||||
|
||||
bool m_expectingChangeTransport;
|
||||
};
|
||||
|
||||
void AddItemsSetItem(Player* player, Item* item);
|
||||
|
||||
@@ -19542,6 +19542,9 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
if (!vehicleBase)
|
||||
return;
|
||||
|
||||
if (IsPlayer())
|
||||
ToPlayer()->SetExpectingChangeTransport(true);
|
||||
|
||||
SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT
|
||||
|
||||
Position pos;
|
||||
|
||||
@@ -423,7 +423,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
if (_me->IsInWorld())
|
||||
{
|
||||
unit->SendClearTarget(); // SMSG_BREAK_TARGET
|
||||
unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures)
|
||||
unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures)
|
||||
if (unit->IsPlayer())
|
||||
unit->ToPlayer()->SetExpectingChangeTransport(true);
|
||||
// also adds MOVEMENTFLAG_ROOT
|
||||
Movement::MoveSplineInit init(unit);
|
||||
init.DisableTransportPathTransformations();
|
||||
|
||||
Reference in New Issue
Block a user