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

CombatHealthFunc crash...

Felipe Muniz

C++ Programmer
Joined
Dec 20, 2007
Messages
15
Reaction score
0
Location
Brazil
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:

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:
Back
Top