Originally posted by [b]Erid[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3978
Hi, in the method "make_new_char(...)" from char.c, there is a little bit of code that i think can be enhanced, when a server add custom hairstyles, normally when creating a new character with the custom hairstyles it returns an error, reading the code i found this:
CODE
//check other inputs
if((slot >= MAX_CHARS) // slots
|| (hair_style >= 24) // hair style
|| (hair_color >= 9) // hair color
|| (str + agi + vit + int_ + dex + luk != 6*5 ) // stats
|| (str < 1 || str > 9 || agi < 1 || agi > 9 || vit < 1 || vit > 9 || int_ < 1 || int_ > 9 || dex < 1 || dex > 9 || luk < 1 || luk > 9) // individual stat values
|| (str + int_ != 10 || agi + luk != 10 || vit + dex != 10) ) // pairs
return -2; // invalid input
The code is using constant values, using definitions from the config could be better for solving this problem to a lot of servers.