Skip to content

Port the fixes from #28, #29 and #32 that still apply after the rebase - #34

Merged
themuffinator merged 9 commits into
mainfrom
claude/port-outside-pr-fixes
Nov 11, 2026
Merged

themuffinator merged 9 commits into
mainfrom
claude/port-outside-pr-fixes

Conversation

@themuffinator

Copy link
Copy Markdown
Owner

Ports the fixes from @bobmoser76's PRs #28, #29 and #32 that still apply after the new-prey rebase. Those PRs were opened against the pre-rebase main. Each commit is credited with Co-authored-by and names the PR it came from. Where main had moved on, the port was adapted, as noted below.

Commit From Notes
Walk the PVS bit vectors in 32-bit words on LP64 platforms #28 long is 8 bytes on Linux/macOS, so area/portal vectors with an odd number of words lost the last one. As in the PR.
Tolerate a NULL activator at level ends and player starts #29, #32 As in the PRs.
Restore unsaved render-entity fields to their constructed state #32 Resets the whole renderEntity_t before reading. This also covers the outline, rim-light and flat-diffuse fields added since. The save format is unchanged.
Unbind an entity before Event_Remove deletes it #32 Leaves out the PR's delay of corpse removal while in view.
Treat onActionRelease-only GUI windows as interactive #32 Retail guis/vehicles/shuttle1.gui has only onActionRelease. Likely the cause of #15.
Guard the renderer against NULL materials before surfaces are added #32 R_GlobalShaderOverride now returns false for NULL, which its callers already test for. R_AddDrawSurf drops a surface and warns once, and still allows a NULL renderEntity.
Keep starting when Linux cannot list its IPv4 interfaces #29 Warns and still enumerates IPv6 interfaces. The PR returned early instead.
Lock the Linux fs_cdpath to the executable's directory #32 Linux now finds staged content beside the executable, as Windows does. Android and macOS are unchanged.
Leave voice-over out of the channel-cushion fade #32 Leaves out the PR's UpdateHardware volume floor.

Left out of #32, and why, is listed on that PR.

Testing

  • Windows x64 debug build of the engine, GL and Vulkan renderers and the unified game module (meson_setup.ps1 setup/compile, forcefallback), with Optimize script type lookup #30 applied on top.
  • Linux and Android code paths (posix_net.cpp, posix_main.cpp) are compiled only by CI.
  • Not yet exercised in game. The shuttle console in game/shuttlea (Docked shuttle interaction #15) and a save/load round trip are the checks worth doing.

themuffinator and others added 9 commits November 10, 2026 16:31
idPVS sized its area and portal visibility vectors in 32-bit steps but
walked them through long pointers. On Linux and macOS x64 and arm64,
long is 8 bytes, so *VisLongs = bytes / sizeof(long) rounded down and
skipped the last word whenever a vector held an odd number of them. Up
to 32 areas or portals then dropped out of the area PVS and of merged
PVS sets, and the portal flood left trailing mightSee bytes unset.
Windows x64 is LLP64 and was not affected.

Use uint32 for the word pointers and the divisors, as dhewm3 does.

Ported from PR #28 (commit dcb024c, Pvs.cpp hunks only).

Co-authored-by: bobmoser76 <[email protected]>
hhTarget_EndLevel::Event_Activate and idPlayerStart::Event_TeleportPlayer
called activator->IsType() unchecked. sys.trigger now passes the local
player, but activate() from script or ActivateTargets can still deliver
NULL. Check the pointer first; idPlayerStart already falls back to the
local player.

Ported from PRs #29 (game_targets.cpp) and #32 (Misc.cpp).

Co-authored-by: bobmoser76 <[email protected]>
idRestoreGame::ReadRenderEntity filled only the fields the save carries.
Inlined static render entities are restored into a fresh
new renderEntity_t and FX actions into list storage, so
suppressSurfaceMask, overlayShader, referenceSoundHandle,
weaponDepthHackInViewID, the LOD fields and the newer outline,
rim-light and flat-diffuse parms reached the renderer uninitialised
after a load. No game code sets any of them, so reset the whole
struct before reading; that matches the memset the constructors do
and covers fields added later. The save format is unchanged.

Ported from PR #32, which zeroed the six fields it knew of.

Co-authored-by: bobmoser76 <[email protected]>
idEntity's destructor calls SetPhysics( NULL ), which passes bindMaster
to the default physics object, before it unbinds, and it runs after
subclass-owned physics objects are destroyed. Detach in Event_Remove
while the entity is intact so that switch never follows a master that
may itself be mid-removal.

Ported from PR #32, without its delay of corpse removal while in the
player's PVS, which would change when scripted removals take effect.

Co-authored-by: bobmoser76 <[email protected]>
idWindow::Interactive only looked for an onAction script. Retail Prey's
shuttle console, guis/vehicles/shuttle1.gui, does its work from
onActionRelease and has no onAction, so the GUI never took focus, the
hand never raised and the docked shuttle terminal could not be used
(issue #15). Count onActionRelease as well.

Ported from PR #32.

Co-authored-by: bobmoser76 <[email protected]>
R_RemapShaderBySkin returns NULL for a NULL source material, and its
callers in tr_light.cpp call R_GlobalShaderOverride before their own
NULL test, so the override dereferenced it. Return false there instead.

R_AddDrawSurf already allows a NULL renderEntity but crashed on missing
geometry, view entity or material. Drop such a surface and warn once.

Ported from PR #32. The renderEntity test is left out, because the
function supports a NULL one.

Co-authored-by: bobmoser76 <[email protected]>
A failed SIOCGIFCONF ioctl made Sys_InitNetworking a fatal error, though
the interface list only classifies LAN addresses. Warn, close the socket
and still enumerate IPv6 interfaces, as the socket-failure branch above
already does.

Ported from PR #29, which returned early and skipped the IPv6 pass.

Co-authored-by: bobmoser76 <[email protected]>
On Linux fs_cdpath was the process working directory, so a desktop
launcher or a shell started elsewhere missed the staged basepr/ overlays
beside the executable. Use the executable's directory, as Windows does,
and fall back to the working directory when /proc cannot resolve it.
Android keeps its extracted content root, and macOS its bundle-aware
implementation.

Ported from PR #32.

Co-authored-by: bobmoser76 <[email protected]>
AdjustForCushionChannels ramps the quietest channels down when the
mixer is under pressure. Voice playback is already exempt from muting
because it cannot restart without breaking speech and lip sync, but the
ramp still faded it towards silence, which retail Prey never did. Skip
channels that cannot be muted.

Ported from PR #32, without its UpdateHardware volume floor, which
would undo distance attenuation for out-of-range speech.

Co-authored-by: bobmoser76 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T16:54:02.562724Z efd625b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@themuffinator

Copy link
Copy Markdown
Owner Author

In-game check of the onActionRelease change for #15 (Windows x64 debug, OpenGL, retail assets).

In game/shuttlea, stepping into dock 29's docking zone spawns its shuttle console, which uses guis/vehicles/shuttle1.gui. I took both builds to the same position and view (eye at -74440 -16 1015, yaw 0):

  • Current main: the weapon stays raised. The console is never treated as interactive.
  • This branch: the player's hand comes up to the console and the weapon moves aside, which is Prey's response when a GUI takes focus.

This reproduced on two runs.

Not checked yet: clicking the console to board the shuttle. Its release action is controlvehicle ; activate, and a scripted click couldn't hold the game window's focus reliably.

Both builds sometimes crash with an access violation during OpenGL shutdown on quit. That happens on main too, so it doesn't come from this branch.

@themuffinator
themuffinator merged commit 386a7a1 into main Nov 11, 2026
6 checks passed
@themuffinator
themuffinator deleted the claude/port-outside-pr-fixes branch November 11, 2026 15:37
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.

1 participant