mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-24 23:49:29 -04:00
Core/Player: Fix crash related to vehicles
Fix assertion triggered when entering a vehicle while channelling a shared vision spell.
Fix #15953
(cherry picked from commit 2cb54d5606)
# Conflicts:
# src/server/game/Entities/Player/Player.cpp
This commit is contained in:
@@ -23858,7 +23858,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
|
||||
// farsight dynobj or puppet may be very far away
|
||||
UpdateVisibilityOf(target);
|
||||
|
||||
if (target->isType(TYPEMASK_UNIT) && !GetVehicle())
|
||||
if (target->isType(TYPEMASK_UNIT) && target != GetVehicleBase())
|
||||
static_cast<Unit*>(target)->AddPlayerToVision(this);
|
||||
}
|
||||
else
|
||||
@@ -23871,7 +23871,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
|
||||
return;
|
||||
}
|
||||
|
||||
if (target->isType(TYPEMASK_UNIT) && !GetVehicle())
|
||||
if (target->isType(TYPEMASK_UNIT) && target != GetVehicleBase())
|
||||
static_cast<Unit*>(target)->RemovePlayerFromVision(this);
|
||||
|
||||
//must immediately set seer back otherwise may crash
|
||||
|
||||
Reference in New Issue
Block a user