Skip to content

Commit

Permalink
Some fields comments for ChrClass and ChrRace. Also optimize code (se…
Browse files Browse the repository at this point in the history
…t MAX_RACES to max_player_race+1).

Note: MAX_* moved out of enum. This is not nice include value _not_ belong to enum values into enum.
Maybe in C this not make sense (enum range = int anyway) but in C++ enum values checked at assigning/etc.
(cherry picked from commit f157c4e)
  • Loading branch information
VladimirMangos committed Dec 14, 2008
1 parent 3ade801 commit 2f0e97e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
24 changes: 17 additions & 7 deletions src/game/SharedDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,24 @@ enum Races
RACE_TAUREN = 6,
RACE_GNOME = 7,
RACE_TROLL = 8,
RACE_GOBLIN = 9,
//RACE_GOBLIN = 9,
RACE_BLOODELF = 10,
RACE_DRAENEI = 11,
RACE_FEL_ORC = 12,
RACE_NAGA = 13,
RACE_BROKEN = 14,
RACE_SKELETON = 15,
MAX_RACES = 16
//RACE_FEL_ORC = 12,
//RACE_NAGA = 13,
//RACE_BROKEN = 14,
//RACE_SKELETON = 15,
//RACE_VRYKUL = 16,
//RACE_TUSKARR = 17,
//RACE_FOREST_TROLL = 18,
//RACE_TAUNKA = 19,
//RACE_NORTHREND_SKELETON = 20,
//RACE_ICE_TROLL = 21
};

// max+1 for player race
#define MAX_RACES 12

#define RACEMASK_ALL_PLAYABLE \
((1<<(RACE_HUMAN-1)) |(1<<(RACE_ORC-1)) |(1<<(RACE_DWARF-1)) | \
(1<<(RACE_NIGHTELF-1))|(1<<(RACE_UNDEAD_PLAYER-1))|(1<<(RACE_TAUREN-1)) | \
Expand All @@ -70,9 +78,11 @@ enum Classes
CLASS_WARLOCK = 9,
// CLASS_UNK2 = 10,unused
CLASS_DRUID = 11,
MAX_CLASSES = 12
};

// max+1 for player class
#define MAX_CLASSES 12

#define CLASSMASK_ALL_PLAYABLE \
((1<<(CLASS_WARRIOR-1))|(1<<(CLASS_PALADIN-1))|(1<<(CLASS_HUNTER-1))| \
(1<<(CLASS_ROGUE-1)) |(1<<(CLASS_PRIEST-1)) |(1<<(CLASS_SHAMAN-1))| \
Expand Down
8 changes: 4 additions & 4 deletions src/shared/Database/DBCStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ struct ChrClassesEntry
// 4, unused
//char* name[16]; // 5-20 unused
// 21 string flag, unused
//char* string1[16]; // 21-36 unused
//char* nameFemale[16]; // 21-36 unused, if different from base (male) case
// 37 string flag, unused
//char* string2[16]; // 38-53 unused
//char* nameNeutralGender[16]; // 38-53 unused, if different from base (male) case
// 54 string flag, unused
// 55, unused
uint32 spellfamily; // 56
Expand All @@ -151,9 +151,9 @@ struct ChrRacesEntry
uint32 startmovie; // 13 id from CinematicCamera.dbc
char* name[16]; // 14-29 used for DBC language detection/selection
// 30 string flags, unused
//char* string1[16]; // 31-46 used for DBC language detection/selection
//char* nameFemale[16]; // 31-46, if different from base (male) case
// 47 string flags, unused
//char* string2[16]; // 48-63 used for DBC language detection/selection
//char* nameNeutralGender[16]; // 48-63, if different from base (male) case
// 64 string flags, unused
// 65-67 unused
uint32 addon; // 68 (0 - original race, 1 - tbc addon, ...)
Expand Down

0 comments on commit 2f0e97e

Please sign in to comment.