- removed entering/exiting vehicle events since we really only care about entered/exited

- made sure to check that the unit who entered/exited a vehicle was actually the player before swapping out units. this was causing the player's health/mana/casting bars to go crazy in battlegrounds and anywhere that people were getting in and out of vehicles around the player
This commit is contained in:
Parnic
2009-07-18 05:38:05 +00:00
parent 19f6814508
commit 759c49e908
3 changed files with 34 additions and 28 deletions

View File

@ -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