Skip to content

fix(test): keep heldbuild::Hit's brace order for existing initialisers - #74

Merged
notchyves merged 1 commit into
theselauraproject:mainfrom
NaySurGithub:fix/heldbuild-hit-order
Nov 6, 2026
Merged

notchyves merged 1 commit into
theselauraproject:mainfrom
NaySurGithub:fix/heldbuild-hit-order

Conversation

@NaySurGithub

Copy link
Copy Markdown
Contributor

Problem

main fails to build on CI since #72, on Linux x64, Linux arm64 and Windows x64 (run 42308722780):

tests/heldbuild_selftest.cpp:29:65: error: too many braces around scalar initializer for type 'bool'
tests/heldbuild_selftest.cpp(29,34): error: excess elements in scalar initializer
tests/heldbuild_selftest.cpp(29,51): error: no viable conversion from 'int' to 'glm::ivec3'

Cause

#72 added bool assist to heldbuild::Hit right after block. heldbuild_selftest brace-initialises the struct by position:

heldbuild::Hit hit{true, {{0, 0, 0}, 5}, {1, 0.5f, 0.5f}};

The target initialiser therefore landed on the new bool. That PR was only built with the Perlin target, so the test was never compiled.

Change

assist moves to the end of Hit, so the existing positional initialisers keep their meaning. Perlin only sets the field by name (hit.assist = ...).

Testing

  • heldbuild_selftest builds and passes locally on macOS arm64 Release: HeldBuild: 69 checks, 0 failures.

theselauraproject#72 inserted 'assist' right after 'block', so heldbuild_selftest's
Hit{true, {{0, 0, 0}, 5}, {1, 0.5f, 0.5f}} fed the target into the bool and
every CI build failed on that test. 'assist' now comes last.
@notchyves
notchyves merged commit db366b9 into theselauraproject:main Nov 6, 2026
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants