Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-03-13 13:03:33 +0000
committerStijn Buys <ingar@osirion.org>2010-03-13 13:03:33 +0000
commitf612f19e095b8d0ba49f5bcdec6a582824315d69 (patch)
treeaa94da4a14254365ead88219726dcc0f3b2c4928 /src/game
parentb16f437accb2db2effde95d7c6afa7dc5dd70bf6 (diff)
small OS X build fixes
ShipModel::search cleanup
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/collision.cc2
-rw-r--r--src/game/base/game.cc5
-rw-r--r--src/game/base/planet.h6
-rw-r--r--src/game/base/shipmodel.cc10
-rw-r--r--src/game/base/shipmodel.h2
5 files changed, 17 insertions, 8 deletions
diff --git a/src/game/base/collision.cc b/src/game/base/collision.cc
index 952bba2..e009b7a 100644
--- a/src/game/base/collision.cc
+++ b/src/game/base/collision.cc
@@ -40,7 +40,7 @@ void Collision::distance_test(core::EntityControlable *first, core::Entity *seco
// warning zone: star corona or planet atmosphere
if ((second->moduletype() == star_enttype) && (d - r < 50.0f)) {
first->owner()->send_warning("^3Warning: entering star corona!^N");
- } else if ((second->moduletype() == planet_enttype) && (d - r < Planet::safe_distance)) {
+ } else if ((second->moduletype() == planet_enttype) && (d - r < planet_safe_distance)) {
first->owner()->send_warning("^3Warning: entering planet gravity well!^N");
}
}
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index 96c0835..729e4f8 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -200,7 +200,6 @@ void Game::func_buy(core::Player *player, const std::string &args)
aux::to_label(labelstr);
}
-
if (typestr.compare("ship") == 0) {
ShipDealer::func_buy(player, labelstr);
} else {
@@ -229,7 +228,7 @@ void Game::func_launch(core::Player *player, std::string const &args)
core::Entity *dock = player->view();
if (dock->type() == core::Entity::Globe)
- ship->get_location().assign(dock->location() + (dock->axis().forward() *(Planet::safe_distance + ship->radius() + dock->radius())));
+ ship->get_location().assign(dock->location() + (dock->axis().forward() *(planet_safe_distance + ship->radius() + dock->radius())));
else
ship->get_location().assign(dock->location() + (dock->axis().forward() *(ship->radius() + dock->radius())));
@@ -299,7 +298,7 @@ void Game::func_goto(core::Player *player, const std::string &args)
ship->shutdown_physics();
if (dock->type() == core::Entity::Globe)
- ship->get_location().assign(dock->location() + (dock->axis().forward() *(Planet::safe_distance + ship->radius() + dock->radius())));
+ ship->get_location().assign(dock->location() + (dock->axis().forward() *(planet_safe_distance + ship->radius() + dock->radius())));
else
ship->get_location().assign(dock->location() + (dock->axis().forward() *(ship->radius() + dock->radius())));
diff --git a/src/game/base/planet.h b/src/game/base/planet.h
index f0bf75f..efc5622 100644
--- a/src/game/base/planet.h
+++ b/src/game/base/planet.h
@@ -32,14 +32,16 @@ public:
/// entity received a docking request
virtual void dock(core::Entity *entity);
- static const float safe_distance = 5.0f;
private:
ShipDealer *planet_shipdealer;
};
-}
+/// FIXME
+const float planet_safe_distance = 5.0f;
+
+} // namespace game
#endif // __INCLUDED_BASE_PLANET_H__
diff --git a/src/game/base/shipmodel.cc b/src/game/base/shipmodel.cc
index a6a2bf9..ed8f09d 100644
--- a/src/game/base/shipmodel.cc
+++ b/src/game/base/shipmodel.cc
@@ -67,11 +67,19 @@ void ShipModel::generate_info()
ShipModel *ShipModel::find(const std::string & label)
{
+ if (!label.size()) {
+ return 0;
+ }
+
return (ShipModel *) core::Info::find(shipmodel_infotype, label);
}
-ShipModel *ShipModel::search(const std::string searchstr)
+ShipModel *ShipModel::search(const std::string & searchstr)
{
+ if (!searchstr.size()) {
+ return 0;
+ }
+
return (ShipModel *) core::Info::search(shipmodel_infotype, searchstr);
}
diff --git a/src/game/base/shipmodel.h b/src/game/base/shipmodel.h
index 3c7f6df..9b428df 100644
--- a/src/game/base/shipmodel.h
+++ b/src/game/base/shipmodel.h
@@ -84,7 +84,7 @@ public:
static ShipModel *find(const std::string & label);
- static ShipModel *search(const std::string searchstr);
+ static ShipModel *search(const std::string & searchstr);
static void list();