@@ -89,7 +89,7 @@ function NativeDropShipAI:Update(Owner)
89
89
elseif Owner .AIMode == Actor .AIMODE_SENTRY then
90
90
self .Waypoint = Owner .Pos ;
91
91
self .DeliveryState = ACraft .STANDBY ;
92
- else
92
+ else -- Deliver, most likely
93
93
local FuturePos = Owner .Pos + Owner .Vel * 20 ;
94
94
95
95
-- Make sure FuturePos is inside the scene
@@ -107,22 +107,16 @@ function NativeDropShipAI:Update(Owner)
107
107
end
108
108
end
109
109
110
- -- Use GetLastAIWaypoint() as a LZ so the AI can give orders to dropships
111
- local Wpt = Owner :GetLastAIWaypoint ();
112
- if (Owner .Pos - Wpt ).Largest > 1 then
113
- self .Waypoint = Wpt ;
110
+ local startingHeight ;
111
+ if SceneMan .SceneOrbitDirection == 0 then
112
+ startingHeight = hoverHeightModifierChanged and Owner .Radius * 1.25 or math.max (Owner .Radius * 1.25 , Owner .Pos .Y );
114
113
else
115
- local startingHeight ;
116
- if SceneMan .SceneOrbitDirection == 0 then
117
- startingHeight = hoverHeightModifierChanged and Owner .Radius * 1.25 or math.max (Owner .Radius * 1.25 , Owner .Pos .Y );
118
- else
119
- startingHeight = Owner .Pos .Y ;
120
- end
121
- local WptL = SceneMan :MovePointToGround (Vector (- Owner .Radius , startingHeight ), self .hoverAlt , 12 );
122
- local WptC = SceneMan :MovePointToGround (Vector (0 , startingHeight ), self .hoverAlt , 12 );
123
- local WptR = SceneMan :MovePointToGround (Vector (Owner .Radius , startingHeight ), self .hoverAlt , 12 );
124
- self .Waypoint = Vector (Owner .Pos .X , math.min (WptL .Y , WptC .Y , WptR .Y ));
114
+ startingHeight = Owner .Pos .Y ;
125
115
end
116
+ local WptL = SceneMan :MovePointToGround (Vector (- Owner .Radius , startingHeight ), self .hoverAlt , 12 );
117
+ local WptC = SceneMan :MovePointToGround (Vector (0 , startingHeight ), self .hoverAlt , 12 );
118
+ local WptR = SceneMan :MovePointToGround (Vector (Owner .Radius , startingHeight ), self .hoverAlt , 12 );
119
+ self .Waypoint = Vector (Owner .Pos .X , math.min (WptL .Y , WptC .Y , WptR .Y ));
126
120
127
121
self .DeliveryState = ACraft .FALL ;
128
122
end
0 commit comments