- currentsector = level->get_sector("main");
- if(!currentsector)
- Termination::abort("Level has no main sector.", "");
- currentsector->activate("main");
-
-#if 0
- // Set Tux to the nearest reset point
- if(tux_pos.x != -1)
- {
- tux_pos = currentsector->get_best_spawn_point(tux_pos);
-
- if(last_swap_point.x > tux_pos.x)
- tux_pos = last_swap_point;
- else // new swap point
- {
- last_swap_point = tux_pos;
-
- last_swap_stats += global_stats;
- }
-
- currentsector->player->base.x = tux_pos.x;
- currentsector->player->base.y = tux_pos.y;
-
- // has to reset camera on swapping
- currentsector->camera->reset(Vector(currentsector->player->base.x,
- currentsector->player->base.y));
- }
-#endif
-
- if (st_gl_mode != ST_GL_DEMO_GAME)
- {
- if(st_gl_mode == ST_GL_PLAY || st_gl_mode == ST_GL_LOAD_LEVEL_FILE)
- levelintro();
+ if(reset_sector != "") {
+ currentsector = level->get_sector(reset_sector);
+ if(!currentsector) {
+ std::stringstream msg;
+ msg << "Couldn't find sector '" << reset_sector << "' for resetting tux.";
+ throw std::runtime_error(msg.str());