From 7afa78ec82243a118d8954a75587486d54a6b378 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 19 Aug 2024 22:05:59 +0200 Subject: [PATCH] Remove obsolete client connection init workaround m_connection_reinit_timer has a head-start of 0.1s and this code only took effect for the very first game session so it was broken anyway. --- src/client/client.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/client/client.cpp b/src/client/client.cpp index 0c222b111..d07a8eb4a 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -436,20 +436,14 @@ void Client::step(float dtime) } } - // UGLY hack to fix 2 second startup delay caused by non existent - // server client startup synchronization in local server or singleplayer mode - static bool initial_step = true; - if (initial_step) { - initial_step = false; - } - else if(m_state == LC_Created) { + if (m_state == LC_Created) { float &counter = m_connection_reinit_timer; counter -= dtime; - if(counter <= 0.0) { - counter = 2.0; + if (counter <= 0) { + counter = 1.5f; LocalPlayer *myplayer = m_env.getLocalPlayer(); - FATAL_ERROR_IF(myplayer == NULL, "Local player not found in environment."); + FATAL_ERROR_IF(!myplayer, "Local player not found in environment"); sendInit(myplayer->getName()); }