• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved [0.4] Mana / HP in percentage bug?

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,767
Solutions
5
Reaction score
769
Hello,
Ive tried looking around but found no answer.

After trying both

The issue I am running into is this:
Its working fine until it passes a certain number I am not aware off. I know it doesnt work above 50mil for instance
1670428605788.png
% stopped working after 2million and this started to show agian, and after 45mil~ I think the percentage got back but this time its stuck at 24/100 with wrong representation until it falls back, is there a fix for this to bring back the % after 2 million?

I have tried enabling/disabling manaPercentAfterClientLimit & HealthPercentAfterClientLimit in Ramon Bernardos code but no luck

Using TFS 0.4 8.6

Any ideas? cheers
 
Last edited:
With the help of Rexxar, it turned out anything above 21474836 breaks it, since its *100 on an int32, so need to figure a solution for this

Post automatically merged:

Update, Rexaar figured the solution if anyone else runs into it in the future.

First use

Then change
Lua:
int32_t health = player->getHealth();

int32_t maxHealth = player->getPlayerInfo(PLAYERINFO_MAXHEALTH);


to
Code:
int64_t health = player->getHealth();

int64_t maxHealth = player->getPlayerInfo(PLAYERINFO_MAXHEALTH);

and
Code:
int32_t mana = player->getPlayerInfo(PLAYERINFO_MANA);

int32_t maxMana = player->getPlayerInfo(PLAYERINFO_MAXMANA);

to
Code:
int64_t mana = player->getPlayerInfo(PLAYERINFO_MANA);

int64_t maxMana = player->getPlayerInfo(PLAYERINFO_MAXMANA);
 
Last edited:
Back
Top