diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-01 16:02:51 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-01 16:02:51 +0000 |
commit | 4e5343ce9aa83a5c0b04bf744dd287fb56ff39fc (patch) | |
tree | 2f5944d3426529a973e78137f8ce5a9a29a7c54f /src/core/gameconnection.cc | |
parent | f5266b403c50cb2b6d712e6d8f41b62ad2433efb (diff) |
various silly fixes
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; } } |