{
using namespace worldmap;
- g_screen_manager->push_screen(new WorldMap(filename));
-}
+ if(World::current() == NULL)
+ throw std::runtime_error("Can't start WorldMap without active world.");
-void load_level(const std::string& filename)
-{
- g_screen_manager->push_screen(new GameSession(filename));
+ g_screen_manager->push_screen(new WorldMap(filename, World::current()->get_player_status()));
}
-static SQInteger squirrel_read_char(SQUserPointer file)
+void load_level(const std::string& filename)
{
- std::istream* in = reinterpret_cast<std::istream*> (file);
- char c = in->get();
- if(in->eof())
- return 0;
+ if(GameSession::current() == NULL)
+ throw std::runtime_error("Can't start level without active level.");
- return c;
+ g_screen_manager->push_screen(new GameSession(filename, GameSession::current()->get_player_status()));
}
void import(HSQUIRRELVM vm, const std::string& filename)