Page MenuHomeWildfire Games

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

Authored by Silier on Sep 1 2020, 1:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 13, 10:00 AM
Unknown Object (File)
Wed, Sep 11, 9:42 PM
Unknown Object (File)
Tue, Sep 10, 3:20 PM
Unknown Object (File)
Mon, Sep 9, 1:14 AM
Unknown Object (File)
Sun, Sep 8, 3:46 PM
Unknown Object (File)
Sun, Sep 8, 2:25 AM
Unknown Object (File)
Wed, Sep 4, 8:21 PM
Subscribers
Restricted Owners Package

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a subscriber: Restricted Owners Package.Sep 1 2020, 1:17 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

Silier requested review of this revision.Sep 1 2020, 1:28 PM

handle true/false values in the same way

Silier 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

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

Freagarach added a subscriber: Freagarach.

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

  • MapSize.js
  • WorldPopulationCap.js
This revision now requires changes to proceed.Sep 10 2020, 5:32 PM

MapSize.js
WorldPopulationCap.js

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?

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

This revision is now accepted and ready to land.Sep 10 2020, 6:43 PM