Bug - Fixed In Plumber, HP is set to 0/<large number> after adventuring

Ryo_Sangnoir

Developer
Staff member
My actual HP is 7/140. After spending an adventure, Mafia will print something like "3003661180 is out of range, returning 0" and then believes my HP is 0/7,001,555 or some other large number.

I flipped back to 19759 at the problem went away.
 
Last edited:

busstop82

New member
i had a similar thing happening - i'm on r19761. after this:
"
> cast 1 CHEAT CODE: Invisible Avatar

You acquire an effect: Invisible Avatar (10)
CHEAT CODE: Invisible Avatar was successfully cast.
25803199128100210 is out of range, returning 0
"
i have 0/4001555 hp; everything back to normal (118/118) after i refreshed the session.
 

Veracity

Developer
Staff member
This is in the Relay Browser, I assume. (For the "after spending an adventure"). The other is a "cast" command.
What style of charpane do you have? normal or compact?
 

Ryo_Sangnoir

Developer
Staff member
Non-compact character pane, "slim" HP view.

The fraction with the hit points looks like:
Code:
<table><tr><td><img src=https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/slimhp.gif title="Hit Points" alt="Hit Points" onclick='doc("hp");' width=20 height=20></td><td valign=center><span class=red>7 / 129</span>  </td>
 

Veracity

Developer
Staff member
That looks normal - and the regexp that should be used for a non-compact Plumber charpane matches it. Looking further...
 

Veracity

Developer
Staff member
Code:
[color=green]> cast 1 CHEAT CODE: Invisible Avatar[/color]

You acquire an effect: Invisible Avatar (10)
CHEAT CODE: Invisible Avatar was successfully cast.
Normal. Requests/responses:

Code:
Requesting: https://www.kingdomofloathing.com/runskillz.php?action=Skillz&whichskill=7324&ajax=1&quantity=1&pwd
Retrieved: https://www.kingdomofloathing.com/runskillz.php?action=Skillz&whichskill=7324&ajax=1&quantity=1&pwd
Processing results...
You acquire an effect: Invisible Avatar (10)
Processing result: Invisible Avatar (10)
CHEAT CODE: Invisible Avatar was successfully cast.
Requesting: https://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: https://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
JSON ... "hp":"5","mp":"22", ... "maxhp":66,"maxmp":33
Since this was done via the GUI, not the Relay Browser, charpane is not involved.
 

Ryo_Sangnoir

Developer
Staff member
19760 introduced this section:
Code:
        /* Accessor method to set the character's current power points
         *
         * @param currentHP The character's current HP value
         * @param maximumHP The character's maximum HP value
         */

        public static final void setPP( final int currentPP, final int maximumPP )
        {
                KoLCharacter.currentHP = currentPP;
                KoLCharacter.maximumHP = maximumPP;

                KoLCharacter.updateStatus();
        }

I don't know whether this is relevant, but I think setting HP instead of PP isn't right.
 

Ryo_Sangnoir

Developer
Staff member
That fixed part of it -- now it's PP which is 0/21,001,555. Unlike the regex, there's no <span> tags for power points.
Code:
<td><img src=https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/slimpp.gif title="Power Points" alt="Power Points"></td><td valign=center>1 / 1</td>
 

Veracity

Developer
Staff member
My charpane has a <span>

Code:
<td><img src=https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/pp.gif title="Power Points" alt="Power Points"><br><span class=black>3 / 3</span></td>
 
Top