Skip to content

Commit ab497c1

Browse files
committed
Simplify Eva stuff
1 parent fb487d0 commit ab497c1

File tree

1 file changed

+2
-15
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameClient

1 file changed

+2
-15
lines changed

GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ static const char *const TheEvaMessageNames[] =
9393
//****************************************************************************
9494
//Kris: Don't forget to add another handler below -- it's ghey-ly implemented.
9595
//****************************************************************************
96-
97-
"EVA_INVALID",
9896
};
99-
static_assert(ARRAY_SIZE(TheEvaMessageNames) == EVA_COUNT + 1, "Incorrect array size");
97+
static_assert(ARRAY_SIZE(TheEvaMessageNames) == EVA_COUNT, "Incorrect array size");
10098

10199
//-------------------------------------------------------------------------------------------------
102100
const ShouldPlayFunc Eva::s_shouldPlayFuncs[] =
@@ -154,7 +152,6 @@ const ShouldPlayFunc Eva::s_shouldPlayFuncs[] =
154152
Eva::shouldPlayGenericHandler,
155153
Eva::shouldPlayGenericHandler,
156154
Eva::shouldPlayGenericHandler,
157-
NULL,
158155
};
159156

160157

@@ -317,10 +314,6 @@ void Eva::update()
317314
//-------------------------------------------------------------------------------------------------
318315
EvaMessage Eva::nameToMessage(const AsciiString& name)
319316
{
320-
DEBUG_ASSERTCRASH( ARRAY_SIZE( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
321-
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT ], "EVA_INVALID" ) == 0, ("TheEvaMessageNames out of sync" ) );
322-
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT - 1], "EVA_INVALID" ) != 0, ("TheEvaMessageNames out of sync" ) );
323-
324317
for (Int i = EVA_FIRST; i < EVA_COUNT; ++i) {
325318
if (name.compareNoCase(TheEvaMessageNames[i]) == 0) {
326319
return (EvaMessage) i;
@@ -334,10 +327,6 @@ EvaMessage Eva::nameToMessage(const AsciiString& name)
334327
//-------------------------------------------------------------------------------------------------
335328
AsciiString Eva::messageToName(EvaMessage message)
336329
{
337-
DEBUG_ASSERTCRASH( ARRAY_SIZE( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
338-
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT ], "EVA_INVALID" ) == 0, ("TheEvaMessageNames out of sync" ) );
339-
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT - 1], "EVA_INVALID" ) != 0, ("TheEvaMessageNames out of sync" ) );
340-
341330
if (message >= EVA_FIRST && message < EVA_COUNT)
342331
return TheEvaMessageNames[message];
343332

@@ -416,9 +405,7 @@ Bool Eva::messageShouldPlay(EvaMessage messageToTest, UnsignedInt currentFrame)
416405
return FALSE;
417406
}
418407

419-
static_assert(ARRAY_SIZE(s_shouldPlayFuncs) == EVA_COUNT + 1, "Incorrect array size");
420-
DEBUG_ASSERTCRASH( s_shouldPlayFuncs[ EVA_COUNT ] == NULL, ("Eva::s_shouldPlayFuncs out of sync" ) );
421-
DEBUG_ASSERTCRASH( s_shouldPlayFuncs[ EVA_COUNT - 1] != NULL, ("Eva::s_shouldPlayFuncs out of sync" ) );
408+
static_assert(ARRAY_SIZE(s_shouldPlayFuncs) == EVA_COUNT, "Incorrect array size");
422409

423410
m_messageBeingTested = messageToTest;
424411
return s_shouldPlayFuncs[messageToTest](m_localPlayer);

0 commit comments

Comments
 (0)