dervin13
Active Member
- Joined
- Apr 26, 2008
- Messages
- 458
- Solutions
- 1
- Reaction score
- 28
Hello, I use the code of health percent but after something about 23kk of life this stop to show 100 percent and shows the number 65445
Is it possible to solve?
thanks
Update:
Solved
int32 has an maxvalue, changed gethealth to int64 in protocolgame.cpp, creature.h and player.h
will check for erros now
C++:
if (player->getMaxHealth() > 0)
{
msg.add<uint16_t>(std::min<int32_t>(player->getHealth() * 100 / player->getMaxHealth(), std::numeric_limits<uint16_t>::max()));
msg.add<uint16_t>(100);
}
else
{
msg.add<uint16_t>(0);
msg.add<uint16_t>(0);
}
Is it possible to solve?
thanks
Update:
Solved
int32 has an maxvalue, changed gethealth to int64 in protocolgame.cpp, creature.h and player.h
will check for erros now
Last edited: