(svn r23611) -Add: run the begin of the script already while generating, and don't sleep on DoCommand while doing so

This commit is contained in:
truebrain
2011-12-19 20:56:50 +00:00
parent cbe43abe5d
commit 83f2785f54
7 changed files with 30 additions and 4 deletions

View File

@@ -34,6 +34,7 @@
#include "progress.h"
#include "error.h"
#include "game/game.hpp"
#include "game/game_instance.hpp"
#include "table/sprites.h"
@@ -166,6 +167,17 @@ static void _GenerateWorld(void *)
if (_game_mode != GM_EDITOR) {
Game::StartNew();
if (Game::GetInstance() != NULL) {
SetGeneratingWorldProgress(GWP_RUNSCRIPT, 2500);
_generating_world = true;
for (i = 0; i < 2500; i++) {
Game::GameLoop();
IncreaseGeneratingWorldProgress(GWP_RUNSCRIPT);
if (Game::GetInstance()->IsSleeping()) break;
}
_generating_world = false;
}
}
}