Page MenuHomeWildfire Games

Don't send useless "Invalid command" debug warnings when regaining capture points
ClosedPublic

Authored by Sandarac on May 5 2017, 11:25 PM.

Details

Reviewers
mimo
sanderd17
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP19727: Don't send useless "Invalid command" debug warnings when regaining capture…
Summary

When setting g_DebugCommands to true in Commands.js, many dozens of Invalid command: attack target is not owned by enemy of player warnings will be logged when a player tries to regain capture points from one of its own structures. This is very annoying when trying to debug the AI (Petra already has checks to make sure targets are owned by enemies).

I guess this may have been overlooked in rP16550 or some other related commit that dealt with capturing.

Test Plan

Set g_DebugCommands to true in Commands.js, and run a game or replay with several Petra bots. Whenever Petra tries to regain capture points from one of its own structures, a warning will be logged. With this diff, these false positives won't be sent 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

Sandarac created this revision.May 5 2017, 11:25 PM
Vulcan added a subscriber: Vulcan.May 6 2017, 2:33 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!

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

leper added reviewers: Restricted Owners Package, mimo, sanderd17.Jun 3 2017, 7:53 PM
mimo accepted this revision.Jun 3 2017, 8:53 PM

Thanks leper, i've missed that one

binaries/data/mods/public/simulation/helpers/Commands.js
172 ↗(On Diff #1671)

!allowCapture could go on the previous line to shorten a bit that line
I'll do it when committing

This revision is now accepted and ready to land.Jun 3 2017, 8:53 PM
This revision was automatically updated to reflect the committed changes.