From d09a1be33a647aedc12ce5ddcb7ea4ee23a75c8c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 30 Jul 2008 16:00:49 +0000 Subject: various minor issues: ESC closing chat, g_autolevel --- src/game/game.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/game/game.cc') diff --git a/src/game/game.cc b/src/game/game.cc index e481c9f..83daa93 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -20,7 +20,7 @@ namespace game { -Game *this_game = 0; + ShipModel *default_shipmodel = 0; core::Zone *default_zone = 0; @@ -183,15 +183,19 @@ void func_jump(core::Player *player, std::string const &args) player->set_zone(zone); } -/*----- Game ------------------------------------------------------ */ +/* ---- The Game class --------------------------------------------- */ + +Game *Game::game_instance = 0; Game::Game() : core::Module("Project::OSiRiON") { - this_game = this; + game_instance = this; + g_autolevel = 0; } Game::~Game() { + game_instance = 0; } void Game::init() @@ -227,8 +231,8 @@ void Game::init() func = core::Func::add("list_ship", (core::FuncPtr) func_list_ship); func->set_info("list ship statistics"); - // set game variables - core::Cvar::set("g_impulsespeed", "10.0f", core::Cvar::Game); + g_autolevel = core::Cvar::get("g_autolevel", "1", core::Cvar::Game | core::Cvar::Archive); + g_autolevel->set_info("[bool] enable or disale experimental autolevelling"); // indicate the module is ready to run frames module_running = true; @@ -236,6 +240,7 @@ void Game::init() void Game::shutdown() { + g_autolevel = 0; // game functions are automaticly removed // remove engine core functions -- cgit v1.2.3