Page MenuHomeWildfire Games

Petra: cleanup of the gameTypeManager
ClosedPublic

Authored by Sandarac on Feb 19 2017, 8:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 13, 3:28 PM
Unknown Object (File)
Fri, Sep 6, 9:48 AM
Unknown Object (File)
Tue, Sep 3, 4:33 PM
Unknown Object (File)
May 5 2017, 12:59 PM
Unknown Object (File)
Mar 28 2017, 11:09 AM
Unknown Object (File)
Mar 18 2017, 7:15 AM
Unknown Object (File)
Mar 16 2017, 7:08 PM
Unknown Object (File)
Mar 14 2017, 3:53 AM
Subscribers

Details

Summary

This diff is in response to the comments in rP19226. If a wonder game starts with any wonders already constructed, these will be added to the criticalEnts Map. assignGuardToCriticalEnt will correctly check if the entity passed to it can actually guard, and some other small improvements to the code's quality have been added.

Test Plan

Check to make sure that wonders are still guarded once they are built, and that (in regicide) the AI still assigns guards to the hero unit when it is transported to a different access index.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 540
Build 861: Vulcan BuildJenkins

Event Timeline

binaries/data/mods/public/simulation/ai/petra/gameTypeManager.js
304

Just a white space fix here.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Thanks for the patch. Looks nearly good.

binaries/data/mods/public/simulation/ai/petra/gameTypeManager.js
191

I think you should add here
if (guardEnt.getMetadata(PlayerID, "guardedEnt")
guardEnt.setMetadata(PlayerID, "guardedEnt", undefined);

382

same remark here, add
if (guardEnt.getMetadata(PlayerID, "guardedEnt")
guardEnt.setMetadata(PlayerID, "guardedEnt", undefined);

389

Shouldn't it return false?

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

This revision was automatically updated to reflect the committed changes.