diff --git a/Core/GameEngine/Include/GameNetwork/GameInfo.h b/Core/GameEngine/Include/GameNetwork/GameInfo.h index 79831cd16f6..73d1d48eced 100644 --- a/Core/GameEngine/Include/GameNetwork/GameInfo.h +++ b/Core/GameEngine/Include/GameNetwork/GameInfo.h @@ -214,7 +214,7 @@ class GameInfo virtual void closeOpenSlots(void); ///< close all slots that are currently unoccupied. // CRC checking hack - void setCRCInterval( Int val ) { m_crcInterval = (val<100)?val:100; } + void setCRCInterval( Int val ) { m_crcInterval = (val<1)?1:((val>100)?100:val); } Int getCRCInterval( void ) const { return m_crcInterval; } Bool haveWeSurrendered(void) { return m_surrendered; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 38927b155e5..bcb4d080318 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -3181,12 +3181,13 @@ void GameLogic::update( void ) // would be getting the CRC anyway, so replays can get the CRCs from the exact instant in time as the original. Bool isMPGameOrReplay = (TheRecorder && TheRecorder->isMultiplayer() && getGameMode() != GAME_SHELL && getGameMode() != GAME_NONE); Bool isSoloGameOrReplay = (TheRecorder && !TheRecorder->isMultiplayer() && getGameMode() != GAME_SHELL && getGameMode() != GAME_NONE); - Bool generateForMP = (isMPGameOrReplay && (m_frame % TheGameInfo->getCRCInterval()) == 0); + Int crcInterval = TheGameInfo->getCRCInterval(); + Bool generateForMP = (isMPGameOrReplay && crcInterval > 0 && (m_frame % crcInterval) == 0); #ifdef DEBUG_CRC Bool generateForSolo = isSoloGameOrReplay && ((m_frame && (m_frame%100 == 0)) || - (getFrame() >= TheCRCFirstFrameToLog && getFrame() < TheCRCLastFrameToLog && ((m_frame % REPLAY_CRC_INTERVAL) == 0))); + (getFrame() >= TheCRCFirstFrameToLog && getFrame() < TheCRCLastFrameToLog && REPLAY_CRC_INTERVAL > 0 && ((m_frame % REPLAY_CRC_INTERVAL) == 0))); #else - Bool generateForSolo = isSoloGameOrReplay && ((m_frame % REPLAY_CRC_INTERVAL) == 0); + Bool generateForSolo = isSoloGameOrReplay && REPLAY_CRC_INTERVAL > 0 && ((m_frame % REPLAY_CRC_INTERVAL) == 0); #endif // DEBUG_CRC if (generateForSolo || generateForMP) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 078a0a3831a..d82cc9ee192 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -3858,12 +3858,13 @@ void GameLogic::update(void) // would be getting the CRC anyway, so replays can get the CRCs from the exact instant in time as the original. Bool isMPGameOrReplay = (TheRecorder && TheRecorder->isMultiplayer() && getGameMode() != GAME_SHELL && getGameMode() != GAME_NONE); Bool isSoloGameOrReplay = (TheRecorder && !TheRecorder->isMultiplayer() && getGameMode() != GAME_SHELL && getGameMode() != GAME_NONE); - Bool generateForMP = (isMPGameOrReplay && (m_frame % TheGameInfo->getCRCInterval()) == 0); + Int crcInterval = TheGameInfo->getCRCInterval(); + Bool generateForMP = (isMPGameOrReplay && crcInterval > 0 && (m_frame % crcInterval) == 0); #ifdef DEBUG_CRC Bool generateForSolo = isSoloGameOrReplay && ((m_frame && (m_frame % 100 == 0)) || - (getFrame() >= TheCRCFirstFrameToLog && getFrame() < TheCRCLastFrameToLog && ((m_frame % REPLAY_CRC_INTERVAL) == 0))); + (getFrame() >= TheCRCFirstFrameToLog && getFrame() < TheCRCLastFrameToLog && REPLAY_CRC_INTERVAL > 0 && ((m_frame % REPLAY_CRC_INTERVAL) == 0))); #else - Bool generateForSolo = isSoloGameOrReplay && ((m_frame % REPLAY_CRC_INTERVAL) == 0); + Bool generateForSolo = isSoloGameOrReplay && REPLAY_CRC_INTERVAL > 0 && ((m_frame % REPLAY_CRC_INTERVAL) == 0); #endif // DEBUG_CRC if (generateForSolo || generateForMP)