EC: party mana and stamina bars jump/oscillate between current value and 100%

ForeverFunForeverFun Posts: 895
edited May 2023 in Bugs
In EC, the party member health bar mana and stamina segments can get in a state where they rapidly jump around between the actual value and 100%.

Below changes to partyhealthbar.lua avoid the oscillating mana and stamina bars for party members.

Note party health bars did not have the un-necessary (#2) data -dependency issue in this thread.

function PartyHealthBar.CreateHealthBar

	-- set initial stamina and mana values @ 100%, until updates come in.
local windowNameStatus = PartyHealthBar.GetWindowName(mobileId)
StatusBarSetCurrentValue( windowNameStatus.."ManaBar", 1 )
StatusBarSetMaximumValue( windowNameStatus.."ManaBar", 1 )
StatusBarSetCurrentValue( windowNameStatus.."StaminaBar", 1 )
StatusBarSetMaximumValue( windowNameStatus.."StaminaBar", 1 )

PartyHealthBar.UpdateStatus(mobileId)

function PartyHealthBar.UpdateStatus

		-- If current and max mana and stamina are zero and mobileId isn't dead, then updates have not come in yet
if( curMana == 0 and maxMana == 0 and mobileData.IsDead == false) then
-- do nothing, leave current values alone. (avoid oscillating bar)
--curMana = 1
--maxMana = 1
else
StatusBarSetCurrentValue( windowName.."ManaBar", curMana )
StatusBarSetMaximumValue( windowName.."ManaBar", maxMana )
end

if( curStamina == 0 and maxStamina == 0 and mobileData.IsDead == false) then
-- do nothing, leave current values alone. (avoid oscillating bar)
--curStamina = 1
--maxStamina = 1
else
StatusBarSetCurrentValue( windowName.."StaminaBar", curStamina )
StatusBarSetMaximumValue( windowName.."StaminaBar", maxStamina )
end

StatusBarSetCurrentValue( windowName.."HealthBar", curHealth )
StatusBarSetMaximumValue( windowName.."HealthBar", maxHealth )

Sign In or Register to comment.