fix(Core/Vehicle): fix crash when using MC on a player riding a vehicle (#24551)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
sogladev 2026-01-29 18:15:43 +01:00 committed by GitHub
parent 0df7baabdc
commit e216838d54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View file

@ -18618,7 +18618,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
ASSERT(type != CHARM_TYPE_POSSESS || charmer->IsPlayer());
if (type == CHARM_TYPE_VEHICLE && !IsVehicle()) // pussywizard
throw 1;
ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle());
ASSERT((type == CHARM_TYPE_VEHICLE) == (GetVehicleKit() && GetVehicleKit()->IsControllableVehicle()));
LOG_DEBUG("entities.unit", "SetCharmedBy: charmer {} ({}), charmed {} ({}), type {}.",
charmer->GetEntry(), charmer->GetGUID().ToString(), GetEntry(), GetGUID().ToString(), uint32(type));