Core/Vehicles: Add additional logging to track issue #24876

(cherry picked from commit f20b7a1080)
This commit is contained in:
Shauren
2021-11-15 09:52:12 +01:00
parent 1d30f7ae2b
commit d6ec0afc78

View File

@@ -22021,7 +22021,20 @@ void Player::StopCastingCharm()
if (charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_PUPPET))
static_cast<Puppet*>(charm)->UnSummon();
else if (charm->IsVehicle())
{
ExitVehicle();
// Temporary for issue https://github.com/TrinityCore/TrinityCore/issues/24876
if (!GetCharmedGUID().IsEmpty() && !charm->HasAuraTypeWithCaster(SPELL_AURA_CONTROL_VEHICLE, GetGUID()))
{
TC_LOG_FATAL("entities.player", "Player::StopCastingCharm Player '%s' (%s) is not able to uncharm vehicle (%s) because of missing SPELL_AURA_CONTROL_VEHICLE",
GetName().c_str(), GetGUID().ToString().c_str(), GetCharmedGUID().ToString().c_str());
// attempt to recover from missing HandleAuraControlVehicle unapply handling
// THIS IS A HACK, NEED TO FIND HOW IS IT EVEN POSSBLE TO NOT HAVE THE AURA
_ExitVehicle();
}
}
}
if (!GetCharmedGUID().IsEmpty())
charm->RemoveCharmAuras();