Page MenuHomeWildfire Games

Read correctly 0/false values from map files in gamesetup
ClosedPublic

Authored by Angen on Tue, Sep 1, 1:17 PM.

Details

Reviewers
Freagarach
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP24037: Read correctly 0/false values from map files in gamesetup
Summary

After rP23374, if map specifies 0 as value in certain settings, this value is ignored.
Fixing that by explicitly checking for undefined.

Test Plan

set relic duration to 0 in some map file with relic victory condition and check it is correctly used in gamesetup.
test any setting with possible 0 value
check all possible settings with 0 value are covered (should be, but one never knows)

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

Angen created this revision.Tue, Sep 1, 1:17 PM
Owners added a subscriber: Restricted Owners Package.Tue, Sep 1, 1:17 PM
Vulcan added a comment.Tue, Sep 1, 1:27 PM

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

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
1 warning generated.
builderr-release-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgraphics.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libatlas.a(precompiled.o) has no symbols
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
1 warning generated.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1451/display/redirect

Angen requested review of this revision.Tue, Sep 1, 1:28 PM
Angen planned changes to this revision.Tue, Sep 1, 5:07 PM

handle true/false values in the same way

Angen updated this revision to Diff 13419.Sat, Sep 5, 6:46 PM
Angen retitled this revision from Read correctly 0 values from map files in gamesetup to Read correctly 0/false values from map files in gamesetup.

rest for true/false

Vulcan added a comment.Sat, Sep 5, 6:53 PM

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

builderr-release-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libatlas.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgui.a(precompiled.o) has no symbols

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1495/display/redirect

Angen updated this revision to Diff 13420.Sat, Sep 5, 7:07 PM
Freagarach requested changes to this revision.Thu, Sep 10, 5:32 PM
Freagarach added a subscriber: Freagarach.

gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns

  • MapSize.js
  • WorldPopulationCap.js
This revision now requires changes to proceed.Thu, Sep 10, 5:32 PM
Angen updated this revision to Diff 13468.Thu, Sep 10, 6:10 PM

MapSize.js
WorldPopulationCap.js

Freagarach added inline comments.Thu, Sep 10, 6:40 PM
binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns/GameSpeed.js
14 ↗(On Diff #13468)

Do we want to enable a gameSpeed of 0?

binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns/MapSize.js
24 ↗(On Diff #13468)

Does a map size of 0 make sense?

binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Sliders/RelicCount.js
21 ↗(On Diff #13468)

Does it make sense to have a RelicCount of 0 when enabling CaptureTheRelic?

Freagarach accepted this revision.Thu, Sep 10, 6:43 PM

It is good read map data correctly. Stupid mapmakers should get stupid results.
Complete.

This revision is now accepted and ready to land.Thu, Sep 10, 6:43 PM
This revision was automatically updated to reflect the committed changes.