mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
43363ee066
commit
7afa78ec82
1 changed files with 4 additions and 10 deletions
|
@ -436,20 +436,14 @@ void Client::step(float dtime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UGLY hack to fix 2 second startup delay caused by non existent
|
if (m_state == LC_Created) {
|
||||||
// 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) {
|
|
||||||
float &counter = m_connection_reinit_timer;
|
float &counter = m_connection_reinit_timer;
|
||||||
counter -= dtime;
|
counter -= dtime;
|
||||||
if(counter <= 0.0) {
|
if (counter <= 0) {
|
||||||
counter = 2.0;
|
counter = 1.5f;
|
||||||
|
|
||||||
LocalPlayer *myplayer = m_env.getLocalPlayer();
|
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());
|
sendInit(myplayer->getName());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue