diff options
-rw-r--r-- | src/game/base/collision.cc | 2 | ||||
-rw-r--r-- | src/game/base/game.cc | 5 | ||||
-rw-r--r-- | src/game/base/planet.h | 6 | ||||
-rw-r--r-- | src/game/base/shipmodel.cc | 10 | ||||
-rw-r--r-- | src/game/base/shipmodel.h | 2 |
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(); |