Code:
if (player_hp > player_max_hp)
		{
			player_hp = player_max_hp;
		}
		if (player_mp > player_max_mp)
		{
			player_mp = player_max_mp;
		}



can be replaced ith:
Code:
player_hp = clamp(player_hp, -1, player_max_hp)
player_mp = clamp(player_mp, -1, player_max_mp)



this codes holds the hp/mp between -1 and the maximum values.. -1 ables you to handle the value 0 or below, too.

else.. the code looks okay to me.. when is the problem appearing?


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<