Page MenuHomeWildfire Games

Add Patrol check to IsWalkingAndFighting
ClosedPublic

Authored by temple on Mar 28 2018, 2:22 AM.

Details

Summary

FindWalkAndFightTargets is done in the PATROL timer, so it makes sense to add it to this function that's used in the COMBAT.ATTACKING timer.
(Might be worth considering merging PATROL and WALKINGANDFIGHTING since they're almost the same state.)

Test Plan

Agree.

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

temple created this revision.Mar 28 2018, 2:22 AM
elexis added a subscriber: elexis.Mar 28 2018, 12:11 PM

It sounds like it's not only for code esthetics but also fixes some bug?

In D1419#58168, @elexis wrote:

It sounds like it's not only for code esthetics but also fixes some bug?

Yes, they process the patrol order for a turn and move towards the patrol point rather than staying where they are and attacking a new target.

mimo accepted this revision.EditedMar 28 2018, 7:35 PM
mimo added a subscriber: mimo.

Yes, agree with the patch.
Maybe changing the name of the function IsWalkingAndFighting to indicate that it is not restricted to WalkAndFight would help? but i've not found good proposition.

This revision is now accepted and ready to land.Mar 28 2018, 7:35 PM

Possibly merging the patrol state sounds possibly reasonable too. Dunno if the patch is complete.
(Patrol was committed on a feature freeze day on sep 1st where lots of features were committed that were left over)

binaries/data/mods/public/simulation/components/UnitAI.js
3321 ↗(On Diff #6282)

Update comment

This revision was automatically updated to reflect the committed changes.