Skip to content

[pull] master from beyond-all-reason:master - #99

Merged
pull[bot] merged 4 commits into
ExaDev:masterfrom
beyond-all-reason:master
Sep 13, 2026
Merged

[pull] master from beyond-all-reason:master#99
pull[bot] merged 4 commits into
ExaDev:masterfrom
beyond-all-reason:master

Conversation

@pull

@pull pull Bot commented Sep 13, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Yaribz and others added 4 commits September 13, 2026 08:28
On Linux hosts, the game statistics stored in the replay/demo files were
incorrectly written using big-endian instead of little-endian. This is
due to the "__BYTE_ORDER" and "__BIG_ENDIAN" macros not being defined
on Linux under some circumstances. This commit fixes this problem by
including the required header <endian.h> just before the macros are
used to detect host endianness.
* TraceRay: block rays that start below the terrain

CGround::LineGroundCol returns a hit distance of 0 when the ray origin is
underground, but TraceRay only accepted ground hits with a distance > 0 and
CWeapon::HaveFreeLineOfFire applied the same filter to the result. A ray from
an underground origin was therefore reported as unobstructed, so a weapon
whose muzzle (or aim-from piece) sat inside a cliff passed the line-of-fire
test, stopped, and could never fire (#3242), and
Spring.GetUnitWeaponHaveFreeLineOfFire told game code the same (#3301).

Accept 0 as a hit in both places: the ray is blocked at its origin.

CCannon::HaveFreeLineOfFire had the same pattern with TrajectoryGroundCol,
which also reports 0 for an origin below the terrain, but tests against
GetApproximateHeight; on rough ground that can lie above a muzzle that is
clear of the interpolated surface. Reject an origin below GetHeightReal
explicitly instead, the test the fire-time check already applies to the
muzzle, and keep ignoring the coarse 0 from the trajectory scan.

The underground test of LineGroundCol itself compared the origin against the
corner vertex of its heightmap square. Next to a steep cliff that vertex can
be far above an origin that is well clear of the ground, which skipped the
whole ground trace. Compare against the interpolated surface instead, and
treat an origin exactly on the surface as above ground; LineGroundSquareCol
still reports a hit at distance 0 when such a ray points into the ground.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Weapons: consistently reject underground line-of-fire sources

Reject sources below real terrain height at the start of both the base
weapon and cannon line-of-fire checks when ground avoidance is enabled.
This matches the existing pre-fire muzzle rejection, including when the
target is within explosion range, and covers the early-return cases.

Preserve the base weapon AoE exception for surface sources and later
ground hits, including zero-distance hits directed into terrain.

Validation: Podman engine-headless build and git diff --check passed.
In-game validation remains pending.

AI assistance: OpenAI Codex prepared the changes and ran the build.

* Weapons: explain differing zero-distance ground checks

Document why the accurate ray trace accepts zero-distance ground hits while the approximate cannon trajectory scan ignores them. No behavior changes.

Validation: git diff --check passed; reviewed comment-only diff.

AI assistance: OpenAI Codex wrote the comments and checked the diff.

* Weapons: clarify line-of-fire terrain comments

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* Fix cleanup after early game load failures

* Clear game pointer after constructor failure
@pull pull Bot locked and limited conversation to collaborators Sep 13, 2026
@pull pull Bot added the ⤵️ pull label Sep 13, 2026
@pull
pull Bot merged commit 92efda5 into ExaDev:master Sep 13, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants