Issue information

Issue ID
#3060
Status
Duplicate
Severity
None
Started
Hercules Elf Bot
May 7, 2009 18:52
Last Post
Hercules Elf Bot
May 7, 2009 18:52
Confirmation
N/A

Hercules Elf Bot - May 7, 2009 18:52

Originally posted by [b]BrianL[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3060

'char.c' (for both SQL and TXT):

CODE
    //check other inputs
    if((slot >= MAX_CHARS) // slots
    || (hair_style >= 24) // hair style
    || (hair_color >= 9) // hair color

In r10044, "9" was changed to the MAX_CHARS constant.
The ranges for valid hair styles and hair colors are also defined in ../trunk/src/common/mmo.h so can't we use those constants too?
CODE
#define MIN_HAIR_STYLE battle_config.min_hair_style
#define MAX_HAIR_STYLE battle_config.max_hair_style
#define MIN_HAIR_COLOR battle_config.min_hair_color
#define MAX_HAIR_COLOR battle_config.max_hair_color


Suggestion: can the hair style/color checks to also use the MIN/MAX constants from mmo.h ?
CODE
    //check other inputs
    if( (slot >= MAX_CHARS) // slots
    || (hair_style < MIN_HAIR_STYLE) || (hair_style > MAX_HAIR_STYLE) // hair style
    || (hair_color < MIN_HAIR_COLOR) || (hair_color > MAX_HAIR_COLOR) // hair color


This post has been edited by BrianL: May 8 2009, 01:36 AM