Page MenuHomeWildfire Games

Cap pack progress at 100% (for the gui)
ClosedPublic

Authored by fatherbushido on Aug 18 2017, 10:19 AM.

Details

Reviewers
bb
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP19999: Cap the pack progress getter at 100% to avoid oversizing bars in the gui.
Summary

Pack component has a GetProgress which is mainly used for/by the gui. (mainly for displaying pack bar).
That kind of function is usually capped at 100%. It's not the case here and at the last pack tick we often exceed 100%. It's obviously visible with the speed cheat code as described in test plan.

Test Plan
  • test caught/catches this. So: ./binaries/system/test
  • In game test: use 'the gift from the gods' or the 'i am too busy' cheat code (not both or two times as it's a reversable cheat). Pack or unpack a packable siege engine. And notice that without the patch

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

fatherbushido created this revision.Aug 18 2017, 10:19 AM
bb accepted this revision as: bb.Aug 18 2017, 10:53 AM
bb added a subscriber: bb.

Patch works as expected, notice that the upgrade component already has such a math.min.

This revision is now accepted and ready to land.Aug 18 2017, 10:53 AM
Vulcan added a subscriber: Vulcan.Aug 18 2017, 11:06 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!
Checking XML files...

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

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  46| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/tests/test_Pack.js
| 135| TS_ASSERT_EQUALS(cmpPack.GetElapsedTime(),·0)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

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

This revision was automatically updated to reflect the committed changes.