Page MenuHomeWildfire Games

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

Authored by Silier on Sep 1 2020, 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)

Event Timeline

Silier created this revision.Sep 1 2020, 1:17 PM
Owners added a subscriber: Restricted Owners Package.Sep 1 2020, 1:17 PM
Vulcan added a comment.Sep 1 2020, 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

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

handle true/false values in the same way

Silier updated this revision to Diff 13419.Sep 5 2020, 6:46 PM
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

Vulcan added a comment.Sep 5 2020, 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

Silier updated this revision to Diff 13420.Sep 5 2020, 7:07 PM
Freagarach requested changes to this revision.Sep 10 2020, 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.Sep 10 2020, 5:32 PM
Silier updated this revision to Diff 13468.Sep 10 2020, 6:10 PM

MapSize.js
WorldPopulationCap.js

Freagarach added inline comments.Sep 10 2020, 6:40 PM
binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns/GameSpeed.js
14

Do we want to enable a gameSpeed of 0?

binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Dropdowns/MapSize.js
24

Does a map size of 0 make sense?

binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Sliders/RelicCount.js
21

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

Freagarach accepted this revision.Sep 10 2020, 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.Sep 10 2020, 6:43 PM
This revision was automatically updated to reflect the committed changes.