Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Generals/Code/GameEngine/Source/Common/GameEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,20 +749,13 @@ void GameEngine::update()
}

const Bool canUpdate = canUpdateGameLogic(FramePacer::IgnoreFrozenTime | FramePacer::IgnoreHaltedGame);
const Bool canUpdateLogic = canUpdate && !TheFramePacer->isGameHalted() && !TheFramePacer->isTimeFrozen();
const Bool canUpdateScript = canUpdate && !TheFramePacer->isGameHalted();
const Bool canUpdateLogic = canUpdate && !TheFramePacer->isGameHalted();

if (canUpdateLogic)
{
TheGameClient->step();
TheGameLogic->UPDATE();
}
else if (canUpdateScript)
{
// TheSuperHackers @info Still update the Script Engine to allow
// for scripted camera movements while the time is frozen.
TheScriptEngine->UPDATE();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3193,6 +3193,12 @@ void GameLogic::update()
TheScriptEngine->UPDATE();
}

// TheSuperHackers @info Update 'is time frozen' because it may have changed after the script engine update.
TheFramePacer->setTimeFrozen(TheGameEngine->isTimeFrozen());

if (TheFramePacer->isTimeFrozen())
return;

// Note - TerrainLogic update needs to happen after ScriptEngine update, but before object updates. jba.
// This way changes in bridges are noted in the script engine before being cleared in TerrainLogic->update
{
Expand Down
9 changes: 1 addition & 8 deletions GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,20 +916,13 @@ void GameEngine::update()
}

const Bool canUpdate = canUpdateGameLogic(FramePacer::IgnoreFrozenTime | FramePacer::IgnoreHaltedGame);
const Bool canUpdateLogic = canUpdate && !TheFramePacer->isGameHalted() && !TheFramePacer->isTimeFrozen();
const Bool canUpdateScript = canUpdate && !TheFramePacer->isGameHalted();
const Bool canUpdateLogic = canUpdate && !TheFramePacer->isGameHalted();

if (canUpdateLogic)
{
TheGameClient->step();
TheGameLogic->UPDATE();
}
else if (canUpdateScript)
{
// TheSuperHackers @info Still update the Script Engine to allow
// for scripted camera movements while the time is frozen.
TheScriptEngine->UPDATE();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3732,6 +3732,12 @@ void GameLogic::update()
TheScriptEngine->UPDATE();
}

// TheSuperHackers @info Update 'is time frozen' because it may have changed after the script engine update.
TheFramePacer->setTimeFrozen(TheGameEngine->isTimeFrozen());

if (TheFramePacer->isTimeFrozen())
return;

// Note - TerrainLogic update needs to happen after ScriptEngine update, but before object updates. jba.
// This way changes in bridges are noted in the script engine before being cleared in TerrainLogic->update
{
Expand Down
Loading