Page MenuHomeWildfire Games

Petra: Move land traders to safety when a trade route is destroyed instead of leaving them idle in the open
ClosedPublic

Authored by Sandarac on Jul 10 2017, 1:38 AM.

Details

Summary

As the title says, if a market is destroyed/captured f.e. by an invading army, and the traders are not assigned to a new trade route, they will
stop moving where they are (which may be towards the territory edge) and stay idle; they then may become surrounded by enemies, and/or they may end up in neutral or enemy territory.

Test Plan

See that the diff causes land traders to move to the closest base, if there is one, instead of stopping to move when there is no route to take.

Possibly test by destroying an AI's market early in a game when it only has two.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 2572
Build 4352: Vulcan BuildJenkins
Build 4351: arc lint + arc unit

Event Timeline

Sandarac created this revision.Jul 10 2017, 1:38 AM
Owners added a subscriber: Restricted Owners Package.Jul 10 2017, 1:38 AM
Vulcan added a subscriber: Vulcan.Jul 10 2017, 2:24 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1724/ for more details.

Sandarac updated this revision to Diff 2883.Jul 10 2017, 10:26 AM

Fix oversight; the traders should only move if !possibleRoute, as well as !ship.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1728/ for more details.

mimo accepted this revision.Jul 10 2017, 6:04 PM

Looks good. There is only one inline comment, but i can fix it when commiting.

binaries/data/mods/public/simulation/ai/petra/tradeManager.js
546

should be removed and use access from line 535

This revision is now accepted and ready to land.Jul 10 2017, 6:04 PM
This revision was automatically updated to reflect the committed changes.