10-20-2019, 03:26 AM
Wow, Moggy didn't account for 0 (Zero) SP? Well, that sucks. But, I have a fix (or fixes) if you don't mind some edits:
On line 214 in the create_sp_meter method, replace
with
On line 545 in the sp_flow_update method, you also replace
with
And finally, on line 526 in the sp_number_refresh method, replace
with
Of course, the line numbers will change once you make your edits. But this makes it so Zero SP is tolerated.
On line 214 in the create_sp_meter method, replace
Code:
@sp_width = @sp_range * @actor.sp / @actor.maxsp
Code:
if @actor.maxsp == 0
@sp_width = 0
else
@sp_width = @sp_range * @actor.sp / @actor.maxsp
end
On line 545 in the sp_flow_update method, you also replace
Code:
@sp_width = @sp_range * @actor.sp / @actor.maxsp
Code:
if @actor.maxsp == 0
@sp_width = 0
else
@sp_width = @sp_range * @actor.sp / @actor.maxsp
end
And finally, on line 526 in the sp_number_refresh method, replace
Code:
@s = @actor.sp * 100 / @actor.maxsp
Code:
if @actor.maxsp == 0
@s = 0
else
@s = @actor.sp * 100 / @actor.maxsp
end
Of course, the line numbers will change once you make your edits. But this makes it so Zero SP is tolerated.