function onLogin(cid)
if getCreatureMana(cid) < 0 then
doCreatureAddMana(cid, getCreatureMana(cid) * -1 + getCreatureMaxMana(cid))
end
return true
end
Code:function onLogin(cid) if getCreatureMana(cid) < 0 then doCreatureAddMana(cid, getCreatureMana(cid) * -1 + getCreatureMaxMana(cid)) end return true end
the thing its happening with you is exactly what Korrex signature image shows
like people said, its impossible to have infinite mana, so the best thing you can do is try to work around it, with this code if your player has negative mana(it went over the limit) it'll simply make him have the max mana he can have
Yeah, can't wait to see the panic and every outdated program that uses dates stop working xD
This'll fix the current mana problem, but I still dont understand, how the hell is the current mana bugging and the max mana isnt? they are both ints..
yeah, I assumed that, but why would the max mana be compiled as uint64 and not the current mana?
Find all strings in the project that has "CreatureMana" and are int32_t and make em int64_t.well
explain how to compile it uint_t 64?
function onLogin(cid)
if (getCreatureMana(cid) =< 0) and (getPlayerLevel(cid) ~= 1) then
doCreatureAddMana(cid, getCreatureMana(cid) * -1 + getCreatureMaxMana(cid))
end
return true
end
void Creature::changeHealth(int32_t healthChange)
{
if(healthChange > 0)
health += std::min(healthChange, getMaxHealth() - health);
else
health = std::max((int32_t)0, health + healthChange);
int32_t health, healthMax;