diff --git a/modules/CastBar.lua b/modules/CastBar.lua index a544851..01dcec0 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -301,8 +301,6 @@ function CastBar.prototype:Enable(core) CastBar.super.prototype.Enable(self, core) self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle") - self:RegisterEvent("UNIT_ENTERING_VEHICLE", "EnteringVehicle") - self:RegisterEvent("UNIT_EXITING_VEHICLE", "ExitingVehicle") self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle") if self.moduleSettings.enabled and not self.moduleSettings.showBlizzCast then @@ -311,15 +309,19 @@ function CastBar.prototype:Enable(core) end -function CastBar.prototype:EnteringVehicle() - self.unit = "vehicle" - self:Update(self.unit) +function CastBar.prototype:EnteringVehicle(unit) + if (unit == "player") then + self.unit = "vehicle" + self:Update(self.unit) + end end -function CastBar.prototype:ExitingVehicle() - self.unit = "player" - self:Update(self.unit) +function CastBar.prototype:ExitingVehicle(unit) + if (unit == "player") then + self.unit = "player" + self:Update(self.unit) + end end diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua index fbb2f80..082e827 100644 --- a/modules/PlayerHealth.lua +++ b/modules/PlayerHealth.lua @@ -76,8 +76,6 @@ function PlayerHealth.prototype:Enable(core) self:RegisterEvent("UNIT_FACTION", "CheckPvP") self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle") - self:RegisterEvent("UNIT_ENTERING_VEHICLE", "EnteringVehicle") - self:RegisterEvent("UNIT_EXITING_VEHICLE", "ExitingVehicle") self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle") if AceLibrary:HasInstance("LibHealComm-3.0") then @@ -669,17 +667,21 @@ function PlayerHealth.prototype:GetOptions() end -function PlayerHealth.prototype:EnteringVehicle() - self.unit = "vehicle" - self:RegisterFontStrings() - self:Update(self.unit) +function PlayerHealth.prototype:EnteringVehicle(unit) + if (unit == "player") then + self.unit = "vehicle" + self:RegisterFontStrings() + self:Update(self.unit) + end end -function PlayerHealth.prototype:ExitingVehicle() - self.unit = "player" - self:RegisterFontStrings() - self:Update(self.unit) +function PlayerHealth.prototype:ExitingVehicle(unit) + if (unit == "player") then + self.unit = "player" + self:RegisterFontStrings() + self:Update(self.unit) + end end diff --git a/modules/PlayerMana.lua b/modules/PlayerMana.lua index f4126b5..ca2fcfb 100644 --- a/modules/PlayerMana.lua +++ b/modules/PlayerMana.lua @@ -112,8 +112,6 @@ function PlayerMana.prototype:Enable(core) self:RegisterEvent("UNIT_RUNIC_POWER", "Update") self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle") - self:RegisterEvent("UNIT_ENTERING_VEHICLE", "EnteringVehicle") - self:RegisterEvent("UNIT_EXITING_VEHICLE", "ExitingVehicle") self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle") -- allow new 'predicted power' stuff to show the power updates constantly instead of ticking @@ -144,17 +142,21 @@ function PlayerMana.prototype:SetupOnUpdate(enable) end -function PlayerMana.prototype:EnteringVehicle() - self.unit = "vehicle" - self:RegisterFontStrings() - self:Update(self.unit) +function PlayerMana.prototype:EnteringVehicle(unit) + if (unit == "player") then + self.unit = "vehicle" + self:RegisterFontStrings() + self:Update(self.unit) + end end -function PlayerMana.prototype:ExitingVehicle() - self.unit = "player" - self:RegisterFontStrings() - self:Update(self.unit) +function PlayerMana.prototype:ExitingVehicle(unit) + if (unit == "player") then + self.unit = "player" + self:RegisterFontStrings() + self:Update(self.unit) + end end