Skip to content

Commit

Permalink
fix deadlock on startup when dropping first frame
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-WAIFU committed Apr 25, 2023
1 parent 623c689 commit 13e1d90
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ void Game::run()
&& !(*kill || g_gamecallback->shutdown_requested
|| (server && server->isShutdownRequested()))) {


float reward;
bool terminal;
if (sync_socket != nullptr) {
Expand Down Expand Up @@ -1312,6 +1313,7 @@ void Game::run()
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
//warningstream << "Time difference = " << std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count() << "[µs]" << std::endl;


const irr::core::dimension2d<u32> &current_screen_size =
m_rendering_engine->get_video_driver()->getScreenSize();
// Verify if window size has changed and save it if it's the case
Expand Down Expand Up @@ -1348,7 +1350,10 @@ void Game::run()


updateProfilers(stats, draw_times, dtime);
processUserInput(dtime);
//skip if there is a recorder and it's the first iteration
if(!recorder || !firstIter){
processUserInput(dtime);
}
// record action
if(recorder && !firstIter) {
pb_objects::Action lastAction = input->getLastAction();
Expand All @@ -1374,6 +1379,7 @@ void Game::run()
resumeAnimation();
}


if (!m_is_paused)
step(dtime);
processClientEvents(&cam_view_target);
Expand Down

0 comments on commit 13e1d90

Please sign in to comment.