Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r--src/game/base/game.cc42
1 files changed, 11 insertions, 31 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index c20e42a..6c15c75 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -59,17 +59,6 @@ core::Module *factory()
return new Game();
}
-// list the ship model registry
-void Game::func_list_ship(std::string const &args)
-{
- ShipModel *shipmodel = ShipModel::search(args);
-
- if (shipmodel)
- shipmodel->print();
- else
- ShipModel::list();
-}
-
// a player joins the game
void Game::func_join(core::Player *player, std::string const &args)
{
@@ -195,27 +184,27 @@ void Game::func_dock(core::Player *player, core::Entity *entity)
void Game::func_buy(core::Player *player, const std::string &args)
{
std::istringstream is(args);
- std::string itemclass;
- std::string itemtype;
+ std::string typestr;
+ std::string labelstr;
- if (!(is >> itemclass)) {
- player->send("usage: buy [string] [string] buy an item of a specified class and type");
+ if (!(is >> typestr)) {
+ player->send("Usage: buy [string] [string] buy an item, specify type and label");
return;
} else {
- aux::to_label(itemclass);
+ aux::to_label(typestr);
}
- if (!(is >> itemtype)) {
- itemtype.clear();
+ if (!(is >> labelstr)) {
+ labelstr.clear();
} else {
- aux::to_label(itemtype);
+ aux::to_label(labelstr);
}
- if (itemclass.compare("ship") == 0) {
- ShipDealer::func_buy(player, itemtype);
+ if (typestr.compare("ship") == 0) {
+ ShipDealer::func_buy(player, labelstr);
} else {
- player->send("unkown item class '" + itemclass + "'");
+ player->send("unkown item type '" + typestr + "'");
}
return;
@@ -333,7 +322,6 @@ void Game::func_goto(core::Player *player, const std::string &args)
Game::Game() : core::Module("Project::OSiRiON", true)
{
Default::clear();
- ShipModel::clear();
Physics::init();
@@ -360,9 +348,6 @@ Game::Game() : core::Module("Project::OSiRiON", true)
// add engine functions
core::Func *func = 0;
- func = core::Func::add("list_ship", Game::func_list_ship);
- func->set_info("[string] list ship statistics");
-
func = core::Func::add("join", Game::func_join);
func->set_info("join the game");
@@ -412,14 +397,9 @@ Game::~Game()
g_impulsespeed = 0;
// game functions are automaticly removed
- // remove engine core functions
- core::Func::remove("list_ship");
-
// we explicity clear game data to prevent bullet from beeing confused
core::game()->clear();
- ShipModel::clear();
-
Physics::shutdown();
}