• 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!

remove full health and mana on level up

felp

New Member
Joined
May 30, 2023
Messages
8
Reaction score
1
hy guys

when the player level up is filling life and mana full life wanted this not to happen
I looked here in the src I just found this but I don't know which line to remove

player.cpp
void Player::setVarStats(stats_t stat, int32_t modifier)
{
varStats[stat] += modifier;

switch (stat) {
case STAT_MAXHITPOINTS: {
if (getHealth() > getMaxHealth()) {
Creature::changeHealth(getMaxHealth() - getHealth());
} else {
g_game.addCreatureHealth(this);
}
break;
}

case STAT_MAXMANAPOINTS: {
if (getMana() > getMaxMana()) {
Creature::changeMana(getMaxMana() - getMana());
}
break;
}

default: {
break;
}
}
}
1685497157909.png
 
I believe you need to remove these 2 lines from player.cpp inside of the addExperience function, then recompile.

void Player::addExperience(Creature* source, uint64_t exp, bool sendText /* = false*/)
Code:
health = getMaxHealth();
mana = getMaxMana();

thank you bro!
 
Back
Top