#include "main.hpp"
#include "spawn_point.hpp"
#include "file_system.hpp"
+#include "physfs/physfs_stream.hpp"
#include "tile_manager.hpp"
#include "tile_set.hpp"
#include "gui/menu.hpp"
const lisp::Lisp* sector = level->get_lisp("sector");
if(!sector)
- throw std::runtime_error("No sector sepcified in worldmap file.");
+ throw std::runtime_error("No sector specified in worldmap file.");
const lisp::Lisp* tilesets_lisp = level->get_lisp("tilesets");
if(tilesets_lisp != NULL) {
if (level->pos == tux->get_tile_pos()) {
try {
Vector shrinkpos = Vector(level->pos.x*32 + 16 - camera_offset.x,
- level->pos.y*32 + 16 - camera_offset.y);
+ level->pos.y*32 + 8 - camera_offset.y);
std::string levelfile = levels_path + level->get_name();
// update state and savegame
save_state();
main_loop->push_screen(new GameSession(levelfile, &level->statistics),
- new ShrinkFade(shrinkpos, 0.5));
+ new ShrinkFade(shrinkpos, 1.0f));
in_level = true;
} catch(std::exception& e) {
log_fatal << "Couldn't load level: " << e.what() << std::endl;
throw SquirrelError(global_vm, "Couldn't set worldmap in roottable");
sq_pop(global_vm, 1);
+ //Run default.nut just before init script
+ try {
+ IFileStream in(levels_path + "/default.nut");
+ run_script(in, "WorldMap::default.nut");
+ } catch(std::exception& ) {
+ // doesn't exist or erroneous; do nothing
+ }
+
+
if(init_script != "") {
std::istringstream in(init_script);
run_script(in, "WorldMap::init");