mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Add more clarity + check the length of the const_str enumeration and the length of the const string array to make sure they both match
This commit is contained in:
parent
0049348de5
commit
17d623bf85
2 changed files with 11 additions and 6 deletions
|
@ -399,12 +399,12 @@ const char *ScriptMaster::ConstStrings[] = {
|
|||
"anim/no_anim_killed.scr",
|
||||
"mg42",
|
||||
"mp40",
|
||||
// Added in 2.0
|
||||
"auto",
|
||||
"both",
|
||||
// Added in 2.30
|
||||
"runandshoot",
|
||||
//
|
||||
// Added in OPM
|
||||
//
|
||||
"respawn",
|
||||
"viewmodelanim_done"
|
||||
};
|
||||
|
@ -525,8 +525,11 @@ void ScriptMaster::InitConstStrings(void)
|
|||
const_str name;
|
||||
unsigned int eventnum;
|
||||
con_map_enum<Event *, EventDef> en;
|
||||
int i;
|
||||
|
||||
for (int i = 0; i < sizeof(ConstStrings) / sizeof(ConstStrings[0]); i++) {
|
||||
static_assert(ARRAY_LEN(ConstStrings) == (STRING_LENGTH_ - 1), "Constant strings don't match. Make sure the 'const_str' enum match with the 'ConstStrings' string array");
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(ConstStrings); i++) {
|
||||
AddString(ConstStrings[i]);
|
||||
}
|
||||
|
||||
|
|
|
@ -306,14 +306,16 @@ enum {
|
|||
STRING_ANIM_NO_KILLED_SCR,
|
||||
STRING_MG42,
|
||||
STRING_MP40,
|
||||
// Added in 2.0
|
||||
STRING_AUTO,
|
||||
STRING_BOTH,
|
||||
// Added in 2.30
|
||||
STRING_RUNANDSHOOT,
|
||||
//
|
||||
// Openmohaa additions
|
||||
//
|
||||
// Added in OPM
|
||||
STRING_RESPAWN,
|
||||
STRING_VIEWMODELANIM_DONE,
|
||||
|
||||
// The number of strings
|
||||
STRING_LENGTH_
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue