From 27345ec20eebccd070287b89cdefb4e4381af5cf Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 23 Feb 2008 19:48:13 +0000 Subject: sv_framerate and cl_framerate --- src/core/application.cc | 4 ++-- src/core/entity.cc | 12 ++++++++---- src/core/gameconnection.cc | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/application.cc b/src/core/application.cc index 7d6f62a..358c655 100644 --- a/src/core/application.cc +++ b/src/core/application.cc @@ -263,12 +263,12 @@ void Application::frame(float seconds) // execute commands in the buffer CommandBuffer::exec(); + application_time += seconds; + // don't run zero lenght time frames if (seconds == 0.0f) return; - application_time += seconds; - if (!connected()) return; diff --git a/src/core/entity.cc b/src/core/entity.cc index 4cce2cb..a0da4ea 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -295,14 +295,18 @@ void EntityControlable::frame(float seconds) void EntityControlable::set_thrust(float thrust) { - target_thrust = thrust; - entity_dirty = true; + if (!(thrust == target_thrust)) { + target_thrust = thrust; + entity_dirty = true; + } } void EntityControlable::set_direction(float direction) { - target_direction = direction; - entity_dirty = true; + if (!(target_direction == direction)) { + target_direction = direction; + entity_dirty = true; + } } } diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc index 07a27a6..4c31f78 100644 --- a/src/core/gameconnection.cc +++ b/src/core/gameconnection.cc @@ -94,6 +94,7 @@ void GameConnection::frame(float seconds) connection_frametime += seconds; f = 1.0f / core::Cvar::sv_framerate->value(); if (connection_frametime < f) { + /* // run client prediction std::map::iterator it; for (it=Entity::registry.begin(); it != Entity::registry.end(); it++) { @@ -102,6 +103,7 @@ void GameConnection::frame(float seconds) entity->frame(seconds); } } + */ return; } } else { -- cgit v1.2.3