diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/base/game.cc | 23 | ||||
-rw-r--r-- | src/game/base/ship.cc | 5 | ||||
-rw-r--r-- | src/game/base/shipmodel.cc | 5 |
3 files changed, 21 insertions, 12 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc index 37a6341..6da899c 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -455,14 +455,17 @@ void Game::func_specs(core::Player *player, const std::string &args) // enable rcon buffering sys::ConsoleInterface::instance()->set_rcon(true); - con_print << "Current ship specifications for " + ship->name() << std::endl; - con_print << "cargo = " << ship->inventory()->capacity() << std::endl; - con_print << "mass = " << ship->shipmodel()->mass() << std::endl; - con_print << "thrust = " << ship->thrust_force() << std::endl; - con_print << "impulse = " << ship->impulse_force() << std::endl; - con_print << "strafe = " << ship->strafe_force() << std::endl; - con_print << "turn = " << ship->turn_force() << std::endl; - con_print << "roll = " << ship->roll_force() << std::endl; + con_print << "^B" << ship->name() << std::endl; + con_print << "Specifications:" << std::endl; + con_print << " ^Nmass = ^B" << ship->mass() << std::endl; + con_print << " ^Nradius = ^B" << ship->radius() << std::endl; + con_print << " ^Ncargo = ^B" << ship->inventory()->capacity() << std::endl; + con_print << "Engines:" << std::endl; + con_print << " ^Nthrust = ^B" << ship->thrust_force() << std::endl; + con_print << " ^Nimpulse = ^B" << ship->impulse_force() << std::endl; + con_print << " ^Nstrafe = ^B" << ship->strafe_force() << std::endl; + con_print << " ^Nturn = ^B" << ship->turn_force() << std::endl; + con_print << " ^Nroll = ^B" << ship->roll_force() << std::endl; // disable rcon buffering sys::ConsoleInterface::instance()->set_rcon(false); @@ -501,7 +504,7 @@ void Game::func_specs(core::Player *player, const std::string &args) msgstr << "Ship roll force set to " << value; } else { - msgstr << "^WUnknown ship specification '" << str << "'"; + msgstr << "^WUnknown ship engine specification '" << str << "'"; } player->send(msgstr.str()); @@ -914,7 +917,7 @@ Game::Game() : core::Module("Project::OSiRiON", true) func->set_info("cheat functions"); func = core::Func::add("specs", Game::func_specs); - func->set_info("change ship specifications"); + func->set_info("change your current ship's engine specifications"); func = core::Func::add("jump", Game::func_jump); func->set_info("[string] activate or deactivate hyperspace jump drive"); diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 65bab4b..40b7812 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -49,6 +49,11 @@ Ship::Ship(core::Player *owner, const ShipModel *shipmodel) : core::EntityContro if (!radius()) { set_radius(0.5f); } + + // mass fallback value + if (!mass()) { + set_mass(radius() * 100.0f); + } if (owner) { // this ship is owned by a player, diff --git a/src/game/base/shipmodel.cc b/src/game/base/shipmodel.cc index 4d7af18..4d5db69 100644 --- a/src/game/base/shipmodel.cc +++ b/src/game/base/shipmodel.cc @@ -182,8 +182,9 @@ ShipModel::ShipModel() : core::Info(shipmodel_infotype) shipmodel_maxspeed = 0; //default specifications - shipmodel_radius = 0; - shipmodel_mass = 10.0f; + shipmodel_radius = 0.0f; + shipmodel_mass = 0.0f; + shipmodel_thrust_force = 0.8f; shipmodel_impulse_force = 4.0f; shipmodel_strafe_force = 0.1f; |