Page MenuHomeWildfire Games

GetNumPlayers and related cleanup
ClosedPublic

Authored by temple on Dec 9 2017, 10:43 PM.

Details

Summary

Some cleanup split from D1050.

Test Plan

ResourceSupply was doing one too many.

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 updated this revision to Diff 4680.Dec 9 2017, 10:43 PM
temple created this revision.

forgot one

vladislavbelov added inline comments.
binaries/data/mods/public/simulation/components/EndGameManager.js
141 ↗(On Diff #4679)

Why this was removed? Wouldn't it be broken in non-visual replays (where we don't have GUI)?

temple added inline comments.Dec 9 2017, 10:55 PM
binaries/data/mods/public/simulation/components/EndGameManager.js
141 ↗(On Diff #4679)

I was under the impression that system entities always existed, so there was no need to check them. But obviously I could be wrong!

Testing a non-visual replay, it seemed to work fine.

vladislavbelov added inline comments.Dec 9 2017, 10:57 PM
binaries/data/mods/public/simulation/components/EndGameManager.js
141 ↗(On Diff #4679)

You checked that this code was executed?

temple added inline comments.Dec 9 2017, 11:04 PM
binaries/data/mods/public/simulation/components/EndGameManager.js
141 ↗(On Diff #4679)

That was on start, so let me check at the end of game too... yep. So it seems even though there's no GUI there still is a GuiInterface component.

Vulcan added a subscriber: Vulcan.Dec 10 2017, 12:33 AM

Successful build - Chance fights ever on the side of the prudent.

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

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
bb added a subscriber: bb.Dec 12 2017, 11:16 PM

There are two more in triggerHelper and wonderVictory (don't be scared of giving my patches some rebase work ;) ), I suppose the endgamemanager is left out for D1115.

binaries/data/mods/public/simulation/components/Capturable.js
299–300 ↗(On Diff #4680)

I guess inlining makes stuff slower so ok

binaries/data/mods/public/simulation/components/ResourceSupply.js
37 ↗(On Diff #4680)

meh newline could be removed

38 ↗(On Diff #4680)

wtf is that comment?, nonsense I suppose since gaia == 0

In D1137#46013, @bb wrote:

There are two more in triggerHelper and wonderVictory (don't be scared of giving my patches some rebase work ;) ), I suppose the endgamemanager is left out for D1115.

Right, I was going to check maps but forgot.

temple updated this revision to Diff 4761.Dec 13 2017, 12:38 AM
Owners added a subscriber: Restricted Owners Package.Dec 13 2017, 12:38 AM
temple added inline comments.Dec 13 2017, 12:42 AM
binaries/data/mods/public/maps/scripts/TriggerHelper.js
152 ↗(On Diff #4761)

This function is then inlined in a loop when it's called, but it doesn't seem like it's called that often so I'm not going to change anything.

binaries/data/mods/public/maps/scripts/WonderVictory.js
36–37 ↗(On Diff #4761)

There's other cleanup possibilities here but I'll leave it for someone else.

bb added inline comments.Dec 13 2017, 12:45 AM
binaries/data/mods/public/maps/scripts/WonderVictory.js
36–37 ↗(On Diff #4761)
temple added inline comments.Dec 13 2017, 12:52 AM
binaries/data/mods/public/maps/scripts/WonderVictory.js
36–37 ↗(On Diff #4761)

:)

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
This revision was automatically updated to reflect the committed changes.