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 2cb54d5606109305194ed3cdb1b56ca62317b891) # 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