Repository navigation
Port the fixes from #28, #29 and #32 that still apply after the rebase - #34
Conversation
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]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
In-game check of the In
This reproduced on two runs. Not checked yet: clicking the console to board the shuttle. Its release action is Both builds sometimes crash with an access violation during OpenGL shutdown on |
Ports the fixes from @bobmoser76's PRs #28, #29 and #32 that still apply after the
new-preyrebase. Those PRs were opened against the pre-rebasemain. Each commit is credited withCo-authored-byand names the PR it came from. Wheremainhad moved on, the port was adapted, as noted below.longis 8 bytes on Linux/macOS, so area/portal vectors with an odd number of words lost the last one. As in the PR.renderEntity_tbefore reading. This also covers the outline, rim-light and flat-diffuse fields added since. The save format is unchanged.guis/vehicles/shuttle1.guihas onlyonActionRelease. Likely the cause of #15.R_GlobalShaderOverridenow returns false for NULL, which its callers already test for.R_AddDrawSurfdrops a surface and warns once, and still allows a NULLrenderEntity.UpdateHardwarevolume floor.Left out of #32, and why, is listed on that PR.
Testing
meson_setup.ps1 setup/compile, forcefallback), with Optimize script type lookup #30 applied on top.posix_net.cpp,posix_main.cpp) are compiled only by CI.game/shuttlea(Docked shuttle interaction #15) and a save/load round trip are the checks worth doing.