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/npc.cc')
-rw-r--r--src/game/base/npc.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/game/base/npc.cc b/src/game/base/npc.cc
index f327f16..f9a600e 100644
--- a/src/game/base/npc.cc
+++ b/src/game/base/npc.cc
@@ -302,13 +302,12 @@ void NPC::frame(const unsigned long elapsed)
if (dock()->moduletype() == ship_enttype)
{
Ship *carrier = static_cast<Ship *>(dock());
+ set_location(carrier->location());
+ set_axis(carrier->axis());
if (zone() != carrier->zone())
{
set_zone(carrier->zone());
- }
- set_location(carrier->location());
- set_axis(carrier->axis());
-
+ }
if (carrier->state() == core::Entity::Destroyed)
{
explode();
@@ -331,7 +330,7 @@ void NPC::frame(const unsigned long elapsed)
} else
{
npc_repair_timestamp = 0;
- if (carrier->state() == core::Entity::Normal)
+ if ( (carrier->state() == core::Entity::Normal) && ((carrier != leader()) || !leader()->has_autopilot_flag(Ship::AutoPilotRecall)) )
{
launch();
}
@@ -341,7 +340,7 @@ void NPC::frame(const unsigned long elapsed)
}
}
} else {
- if (leader()->has_flag(core::Entity::Dockable) && (health() < NPC_REPAIR_WIMPY))
+ if (leader()->has_flag(core::Entity::Dockable) && ((health() < NPC_REPAIR_WIMPY) || leader()->has_autopilot_flag(Ship::AutoPilotRecall)) )
{
set_autopilot_target(leader());
@@ -382,10 +381,18 @@ void NPC::frame(const unsigned long elapsed)
}
} else {
-
// leader is not in this zone
- if (!autopilot_target()) {
-
+ if ((state() == core::Entity::Docked) && (dock()) && (dock()->moduletype() == ship_enttype))
+ {
+ Ship *carrier = static_cast<Ship *>(dock());
+ set_location(carrier->location());
+ set_axis(carrier->axis());
+ if (zone() != carrier->zone())
+ {
+ set_zone(carrier->zone());
+ }
+ } else if (!autopilot_target())
+ {
target_direction = 0;
target_pitch = 0;
target_roll = 0;