diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 519928e..d312214 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -298,6 +298,7 @@ function CastBar.prototype:Enable(core) self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle") self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle") + self:RegisterEvent("PLAYER_ENTERING_WORLD", "CheckVehicle") if self.moduleSettings.enabled and not self.moduleSettings.showBlizzCast then self:ToggleBlizzCast(false) @@ -321,6 +322,15 @@ function CastBar.prototype:ExitingVehicle(event, unit) end +function CastBar.prototype:CheckVehicle() + if UnitHasVehicleUI("player") then + self:EnteringVehicle(nil, "player", true) + else + self:ExitingVehicle(nil, "player") + end +end + + function CastBar.prototype:Disable(core) CastBar.super.prototype.Disable(self, core)