From 03d5bc014c0e815c6aaeec16d81e225e08732ab0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 10 Nov 2008 18:02:13 +0000 Subject: adds jumpgate, station, ship dealer --- src/game/base/ship.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game/base/ship.cc') diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 3e4db42..214d234 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -157,6 +157,7 @@ void Ship::func_jump(std::string const &args) return; } else { + if (!jumpdrive() && !Game::g_devel->value()) { owner()->send("This ship is not equiped with a hyperspace drive!"); return; @@ -171,19 +172,18 @@ void Ship::func_jump(std::string const &args) entity_eventstate = core::Entity::Normal; return; } - initiate_jump(find_closest_jumppoint()); } } JumpPoint * Ship::find_closest_jumppoint() { - // find closest jumppoint + // find closest jumpgate or jumppoint float d = -1; JumpPoint *jumppoint = 0; for (core::Zone::Content::iterator it = zone()->content().begin(); it != zone()->content().end(); it++) { core::Entity *entity = (*it); - if (entity->moduletype() == jumppoint_enttype) { + if ((entity->moduletype() == jumppoint_enttype) || (entity->moduletype() == jumpgate_enttype)) { JumpPoint *te = static_cast(entity); float d1 = math::distance(location(), te->location()); if ((d < 0) || (d1 < d)) { -- cgit v1.2.3