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

Solved [C++] Server Error

fegarox

New Member
Joined
Oct 6, 2010
Messages
19
Reaction score
0
I'm making a pokemon server, and i added the following code in combat.cpp so that the player could not attack your summon.

Code:
	if(attackerPlayer == target->getMaster())
				return RET_YOUMAYNOTATTACKTHISCREATURE;


All right, the program was compiled, but when i try to attack a wild pokemon, i receive a crash. If i try to attack my pokemon, all right, i can't.

Someone help? Thanks!
 
Last edited:
add it inside this instead
Code:
			if(target->getMaster() && target->getMaster()->getPlayer())
			{
				checkZones = true;
				if([B]attackerPlayer == target->getMaster() || [/B]g_game.getWorldType() == WORLD_TYPE_NO_PVP && !Combat::isInPvpZone(attacker, target))
					return RET_YOUMAYNOTATTACKTHISCREATURE;
			}
 
EDIT: OMG, this error continues. The crash is on client.

--

I found the error. Solved. Once more thanks all.
 
Last edited:
Back
Top