From ecc2253758c536753036ae4ab5ed5e7b1d891c8d Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sun, 30 Apr 2006 03:57:58 +0000 Subject: fixed some problems of the timer class --- src/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 951d9b4..a092220 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -334,6 +334,8 @@ void parseOptions(int argc, char *argv[]) */ int main(int argc, char *argv[]) { + int elapsedWorldTicks; + LOG_INFO("The Mana World Server v" << PACKAGE_VERSION, 0) // Parse Command Line Options @@ -398,8 +400,14 @@ int main(int argc, char *argv[]) worldTimer.start(); while (running) { - if (worldTimer.poll()) { - worldTime++; + elapsedWorldTicks = worldTimer.poll(); + if (elapsedWorldTicks > 0) { + worldTime += elapsedWorldTicks; + + if (elapsedWorldTicks > 1) + { + LOG_WARN(elapsedWorldTicks -1 <<" World Tick(s) skipped because of insufficient time. please buy a faster machine ;-)", 0); + }; // Print world time at 10 second intervals to show we're alive if (worldTime % 100 == 0) { -- cgit