diff options
Diffstat (limited to 'src/core/gameconnection.cc')
-rw-r--r-- | src/core/gameconnection.cc | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc index 923d9a3..4f410d5 100644 --- a/src/core/gameconnection.cc +++ b/src/core/gameconnection.cc @@ -88,29 +88,18 @@ void GameConnection::frame(float seconds) return; } - + connection_frametime += seconds; + float f = 0; - if (core::Cvar::sv_framerate->value()) { - connection_frametime += seconds; + if (core::Cvar::sv_framerate->value()) { f = 1.0f / core::Cvar::sv_framerate->value(); if (connection_frametime < f) { - /* - // run client prediction - std::map<unsigned int, Entity *>::iterator it; - for (it=Entity::registry.begin(); it != Entity::registry.end(); it++) { - Entity *entity = (*it).second; - if ((entity->type() == Entity::Controlable) || (entity->type() == Entity::Dynamic)) { - entity->frame(seconds); - } - } - */ return; } - } else { - connection_frametime = seconds; } - + connection_network->frame(connection_frametime); + connection_frametime = 0; if (localcontrol() && localcontrol()->dirty()) { std::ostringstream netmsg; @@ -135,7 +124,6 @@ void GameConnection::frame(float seconds) } connection_network->transmit(); - connection_frametime += f; } } |