Page MenuHomeWildfire Games

petra: fix an garrison/ungarrison loop due to rP19547
ClosedPublic

Authored by mimo on May 30 2017, 9:35 PM.

Details

Summary

Fix a problem described by Sandarac in D545, when a non-defensive enemy structure is near one of our defensive struct, the ai constantly garrison and ungarrison units

Test Plan

Test in the situation described that this does not happen anymore

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Vulcan added a subscriber: Vulcan.May 30 2017, 10:22 PM

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/1417/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/86/ for more details.

mimo added a comment.May 31 2017, 5:51 PM


a small commands.txt for testing the patch

In D579#23883, @mimo wrote:


a small commands.txt for testing the patch

Okay, I tested with and without the patch with this commands.txt, and it was useful to see the fix.
But I have a little concern with the comment.

binaries/data/mods/public/simulation/ai/petra/defenseManager.js
479 ↗(On Diff #2320)

I find this comment a little confusing, saying that non-defensive structure are "removed", would it be better to say instead that non-defensive structures are not considered?

mimo updated this revision to Diff 2364.Jun 1 2017, 7:59 PM

fix comment

Sandarac accepted this revision.Jun 1 2017, 9:01 PM

Okay, this fixes the garrison/ungarrison loop in the described case.

This revision is now accepted and ready to land.Jun 1 2017, 9:01 PM
This revision was automatically updated to reflect the committed changes.

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/1438/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/100/ for more details.