Felipe Muniz
C++ Programmer
I made a small change in Combat: CombatHealthFunc, which is causing me a big headache <_< ... The idea is not to allow a player with protection level, heal another player who is not protection level. Here is what I modified:
The code works apparently normal, but when I put the server with several players, the server crash ... I maked many tests, and do not know what can be ...
Please, help me if you can.
Greetings,
Felipe Muniz.
Code:
if(params.combatType == COMBAT_HEALING && caster->getPlayer() && target->getPlayer()){
if(caster->getPlayer()->getLevel() < g_config.getNumber(ConfigManager::PROTECTION_LEVEL) &&
target->getPlayer()->getLevel() >= g_config.getNumber(ConfigManager::PROTECTION_LEVEL)){
//std::cout << "Combat::CombatHealthFunc[COMBAT_HEALING]: " << caster->getName() << " & " << target->getName() << std::endl;
g_game.addMagicEffect(target->getPosition(), NM_ME_POFF);
return 0;
}
}
The code works apparently normal, but when I put the server with several players, the server crash ... I maked many tests, and do not know what can be ...
Please, help me if you can.
Greetings,
Felipe Muniz.
Last edited: