mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- fixed the player's health and mana bars monitoring the wrong unit whenever the player leaves an instance while in a vehicle
This commit is contained in:
@ -908,6 +908,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function PlayerHealth.prototype:EnteringWorld()
|
function PlayerHealth.prototype:EnteringWorld()
|
||||||
|
self:CheckVehicle()
|
||||||
self:CheckCombat()
|
self:CheckCombat()
|
||||||
self:CheckLeader()
|
self:CheckLeader()
|
||||||
self:CheckPartyRole()
|
self:CheckPartyRole()
|
||||||
@ -916,6 +917,14 @@ function PlayerHealth.prototype:EnteringWorld()
|
|||||||
self:Resting()
|
self:Resting()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function PlayerHealth.prototype:CheckVehicle()
|
||||||
|
if UnitHasVehicleUI("player") then
|
||||||
|
self:EnteringVehicle(nil, "player", true)
|
||||||
|
else
|
||||||
|
self:ExitingVehicle(nil, "player")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function PlayerHealth.prototype:Resting()
|
function PlayerHealth.prototype:Resting()
|
||||||
self.resting = IsResting()
|
self.resting = IsResting()
|
||||||
|
@ -120,6 +120,7 @@ function PlayerMana.prototype:Enable(core)
|
|||||||
|
|
||||||
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle")
|
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle")
|
||||||
self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle")
|
self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle")
|
||||||
|
self:RegisterEvent("PLAYER_ENTERING_WORLD", "CheckVehicle")
|
||||||
|
|
||||||
if not self.CustomOnUpdate then
|
if not self.CustomOnUpdate then
|
||||||
self.CustomOnUpdate = function() self:Update(self.unit) end
|
self.CustomOnUpdate = function() self:Update(self.unit) end
|
||||||
@ -135,6 +136,14 @@ function PlayerMana.prototype:Enable(core)
|
|||||||
self:ManaType(nil, self.unit)
|
self:ManaType(nil, self.unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function PlayerMana.prototype:CheckVehicle()
|
||||||
|
if UnitHasVehicleUI("player") then
|
||||||
|
self:EnteringVehicle(nil, "player", true)
|
||||||
|
else
|
||||||
|
self:ExitingVehicle(nil, "player")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function PlayerMana.prototype:ShouldUseTicker()
|
function PlayerMana.prototype:ShouldUseTicker()
|
||||||
return IceHUD.WowVer < 30000 or not GetCVarBool("predictedPower")
|
return IceHUD.WowVer < 30000 or not GetCVarBool("predictedPower")
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user