summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-09 20:19:51 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-09 20:19:51 +0300
commitf1db2118bec94c32ebda6a281dc956ba1a480163 (patch)
tree21e81d9701cc758d0d1bf171c657ba4f722b69df /src/game.cpp
parent4aeceabb5d4f00e2555234951a2f5db24b008265 (diff)
downloadmanaverse-f1db2118bec94c32ebda6a281dc956ba1a480163.tar.gz
manaverse-f1db2118bec94c32ebda6a281dc956ba1a480163.tar.bz2
manaverse-f1db2118bec94c32ebda6a281dc956ba1a480163.tar.xz
manaverse-f1db2118bec94c32ebda6a281dc956ba1a480163.zip
Improve slow login update speed.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 0fc4c36b1..465911767 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -385,7 +385,8 @@ Game::Game():
mAdjustPerfomance(config.getBoolValue("adjustPerfomance")),
mLowerCounter(0),
mPing(0),
- mLogInput(config.getBoolValue("logInput"))
+ mLogInput(config.getBoolValue("logInput")),
+ mTime(cur_time + 1)
{
touchManager.setInGame(true);
spellManager = new SpellManager;
@@ -571,20 +572,25 @@ void Game::slowLogic()
BLOCK_START("Game::slowLogic")
if (player_node)
player_node->slowLogic();
- if (botCheckerWindow)
- botCheckerWindow->slowLogic();
- if (debugWindow)
- debugWindow->slowLogic();
- if (killStats)
- killStats->update();
- if (socialWindow)
- socialWindow->slowLogic();
- if (whoIsOnline)
- whoIsOnline->slowLogic();
+ const int time = cur_time;
+ if (mTime <= time)
+ {
+ mTime = time + 1;
+ if (botCheckerWindow)
+ botCheckerWindow->slowLogic();
+ if (debugWindow)
+ debugWindow->slowLogic();
+ if (killStats)
+ killStats->update();
+ if (socialWindow)
+ socialWindow->slowLogic();
+ if (whoIsOnline)
+ whoIsOnline->slowLogic();
+ Being::reReadConfig();
+ if (killStats)
+ killStats->recalcStats();
+ }
- Being::reReadConfig();
- if (killStats)
- killStats->recalcStats();
if (shopWindow)
shopWindow->updateTimes();
if (mainGraphics->getOpenGL())