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:
jackpoz
2015-12-07 23:34:00 +01:00
committed by MitchesD
parent 1ab8f0b00e
commit bb97e888ff
+2 -2
View File
@@ -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