Skip to content

Commit c5d0d69

Browse files
committed
Merge remote-tracking branch 'data/development' into development
# Conflicts: # meson.build
2 parents 0d6a3b8 + 240f75e commit c5d0d69

File tree

1,692 files changed

+167809
-1420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,692 files changed

+167809
-1420
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ luac.out
7373
CortexCommand
7474
CortexCommand_debug
7575

76+
# Debug databases
77+
*.pdb
78+
7679
# Manifest files
7780
*.manifest
7881

Data/Base.rte/AI/CrabAI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
require("AI/NativeCrabAI"); --dofile("Base.rte/Actors/AI/NativeCrabAI.lua")
1+
require("AI/NativeCrabAI");
22

33
function Create(self)
44
self.AI = NativeCrabAI:Create(self);
55
end
66

7-
function UpdateAI(self)
7+
function ThreadedUpdateAI(self)
88
self.AI:Update(self);
99
end
1010

Data/Base.rte/AI/CrabBehaviors.lua

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@ function CrabBehaviors.Sentry(AI, Owner, Abort)
100100

101101
Owner:AddAISceneWaypoint(Vector(Owner.Pos.X, 0));
102102
Owner:UpdateMovePath();
103-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
104-
if _abrt then return true end
103+
104+
-- wait until movepath is updated
105+
while Owner.IsWaitingOnNewMovePath do
106+
local _ai, _ownr, _abrt = coroutine.yield();
107+
if _abrt then return true end
108+
end
105109

106110
-- face the direction of the first waypoint
107111
for WptPos in Owner.MovePath do
@@ -354,7 +358,7 @@ function CrabBehaviors.GoToWpt(AI, Owner, Abort)
354358
Waypoint = table.remove(WptList, 1);
355359
if WptList[1] then
356360
Owner:RemoveMovePathBeginning();
357-
elseif not Owner.MOMoveTarget and SceneMan:ShortestDistance(Owner.Pos, Waypoint.Pos, false).X < 10 then -- the last waypoint
361+
elseif not Owner.MOMoveTarget and SceneMan:ShortestDistance(Owner.Pos, Waypoint.Pos, false):MagnitudeIsLessThan(Owner.MoveProximityLimit) then -- the last waypoint
358362
Owner:ClearMovePath();
359363
WptList = nil;
360364
Waypoint = nil;
@@ -367,18 +371,26 @@ function CrabBehaviors.GoToWpt(AI, Owner, Abort)
367371
AI.lateralMoveState = Actor.LAT_LEFT;
368372
elseif CurrDist.X > 3 then
369373
AI.lateralMoveState = Actor.LAT_RIGHT;
370-
else
374+
end
375+
376+
if CurrDist:MagnitudeIsLessThan(Owner.MoveProximityLimit) then
371377
Waypoint = nil;
372378
end
373379
end
374380
end
375-
else -- no waypoint list, create one in several small steps to reduce lag
381+
else -- no waypoint list, create one
376382
local TmpList = {};
377383
table.insert(TmpList, {Pos=Owner.Pos});
384+
378385
Owner:UpdateMovePath();
386+
387+
-- wait until movepath is updated
388+
while Owner.IsWaitingOnNewMovePath do
389+
local _ai, _ownr, _abrt = coroutine.yield();
390+
if _abrt then return true end
391+
end
392+
379393
Owner:DrawWaypoints(true);
380-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
381-
if _abrt then return true end
382394

383395
for WptPos in Owner.MovePath do -- skip any waypoint too close to the previous one
384396
if SceneMan:ShortestDistance(TmpList[#TmpList].Pos, WptPos, false):MagnitudeIsGreaterThan(10) then
@@ -399,9 +411,6 @@ function CrabBehaviors.GoToWpt(AI, Owner, Abort)
399411
end
400412
end
401413

402-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
403-
if _abrt then return true end
404-
405414
WptList = TmpList;
406415

407416
-- create the move path seen on the screen

Data/Base.rte/AI/DropShipAI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
require("AI/NativeDropShipAI"); --dofile("Base.rte/Actors/AI/NativeDropShipAI.lua");
1+
require("AI/NativeDropShipAI");
22

33
function Create(self)
44
self.AI = NativeDropShipAI:Create(self);
55
end
66

7-
function UpdateAI(self)
7+
function ThreadedUpdateAI(self)
88
self.AI:Update(self);
99
end

Data/Base.rte/AI/HumanAI.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require("AI/NativeHumanAI");
33
function Create(self)
44
self.AI = NativeHumanAI:Create(self);
55
end
6-
function UpdateAI(self)
6+
function ThreadedUpdateAI(self)
77
self.AI:Update(self);
88
end
99
function Destroy(self)

0 commit comments

Comments
 (0)