Skip to content

Commit af97104

Browse files
authored
[GEN][ZH] Simplify RecorderClass::appendNextCommand() (#1016)
1 parent 007b3ae commit af97104

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

Generals/Code/GameEngine/Source/Common/Recorder.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,16 +1306,6 @@ void RecorderClass::appendNextCommand() {
13061306
}
13071307

13081308
GameMessage *msg = newInstance(GameMessage)(type);
1309-
if (type == GameMessage::MSG_BEGIN_NETWORK_MESSAGES || type == GameMessage::MSG_CLEAR_GAME_DATA)
1310-
{
1311-
}
1312-
else
1313-
{
1314-
if (!m_doingAnalysis)
1315-
{
1316-
TheCommandList->appendMessage(msg);
1317-
}
1318-
}
13191309

13201310
#ifdef DEBUG_LOGGING
13211311
AsciiString commandName = msg->getCommandAsAsciiString();
@@ -1387,13 +1377,11 @@ void RecorderClass::appendNextCommand() {
13871377
}
13881378
}
13891379

1390-
if (type == GameMessage::MSG_CLEAR_GAME_DATA || type == GameMessage::MSG_BEGIN_NETWORK_MESSAGES)
1380+
if (type != GameMessage::MSG_BEGIN_NETWORK_MESSAGES && type != GameMessage::MSG_CLEAR_GAME_DATA && !m_doingAnalysis)
13911381
{
1392-
deleteInstance(msg);
1393-
msg = NULL;
1382+
TheCommandList->appendMessage(msg);
13941383
}
1395-
1396-
if (m_doingAnalysis)
1384+
else
13971385
{
13981386
deleteInstance(msg);
13991387
msg = NULL;

GeneralsMD/Code/GameEngine/Source/Common/Recorder.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,16 +1309,6 @@ void RecorderClass::appendNextCommand() {
13091309
}
13101310

13111311
GameMessage *msg = newInstance(GameMessage)(type);
1312-
if (type == GameMessage::MSG_BEGIN_NETWORK_MESSAGES || type == GameMessage::MSG_CLEAR_GAME_DATA)
1313-
{
1314-
}
1315-
else
1316-
{
1317-
if (!m_doingAnalysis)
1318-
{
1319-
TheCommandList->appendMessage(msg);
1320-
}
1321-
}
13221312

13231313
#ifdef DEBUG_LOGGING
13241314
AsciiString commandName = msg->getCommandAsAsciiString();
@@ -1390,13 +1380,11 @@ void RecorderClass::appendNextCommand() {
13901380
}
13911381
}
13921382

1393-
if (type == GameMessage::MSG_CLEAR_GAME_DATA || type == GameMessage::MSG_BEGIN_NETWORK_MESSAGES)
1383+
if (type != GameMessage::MSG_BEGIN_NETWORK_MESSAGES && type != GameMessage::MSG_CLEAR_GAME_DATA && !m_doingAnalysis)
13941384
{
1395-
deleteInstance(msg);
1396-
msg = NULL;
1385+
TheCommandList->appendMessage(msg);
13971386
}
1398-
1399-
if (m_doingAnalysis)
1387+
else
14001388
{
14011389
deleteInstance(msg);
14021390
msg = NULL;

0 commit comments

Comments
 (0)