• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

Health Bars

Bleak

UO Software Engineer
VIP
Stratics Veteran
Stratics Legend
Had sometime tonight and I found the issue in Pinco's:
function MobileHealthBar.UpdateStatus(mobileId)
local windowName = "MobileHealthBar_"..mobileId

Broken:
if(WindowData.MobileStatus[mobileId] and MobileHealthBar.hasWindow[mobileId] == true and IsMobile(mobileId)) then
Fixed:
if(WindowData.MobileStatus[mobileId] and MobileHealthBar.hasWindow[mobileId] == true) then

The IsMobile is returning false since the mob has been deleted so it will not properly updated.
Another suggestion would be to move the following code to directly after theMobileHealthBar.hasWindow check before doing anything else:
--Set mobile's health status bar
local curHealth = WindowData.MobileStatus[mobileId].CurrentHealth
local maxHealth = WindowData.MobileStatus[mobileId].MaxHealth

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

Let me know if you have anymore issues.
To view the original post, please click here
 
Top