Skip to content

patches: guard null actor in AI message send (#1130) - #1156

Open
jfpaardoo wants to merge 1 commit into
Revivedx:testfrom
jfpaardoo:fix/1130-null-actor-ai-msg
Open

jfpaardoo wants to merge 1 commit into
Revivedx:testfrom
jfpaardoo:fix/1130-null-actor-ai-msg

Conversation

@jfpaardoo

@jfpaardoo jfpaardoo commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Guards against a null actor pointer in AI message sending when a linked actor has already despawned (*** exception c0000005 accessing 0x5f0).

  • tools/game_sites.py: added the stale_actor_ai_msg site (1.9.0 0x7000bbb670), its entry in OPTIONAL_GROUPS, and KNOWN['1.9.0'].
  • tools/patches.py: added _stale_actor_ai_msg to guard ldr x20, [x1, #0x5f0] when x1 (returned by 0x700056b818 in 0x70009782e4) is null, clearing [x0 + 0x14] and returning false via the function's own cbz x21 early-exit epilogue.

Fixes #1130

How it was tested

On Windows 11 (NVIDIA GeForce RTX 3050 Laptop GPU, MSYS2 UCRT64 clang):

  • tools/venv/Scripts/python.exe tools/test_game_sites.py: ok: 46 checks.
  • tools/venv/Scripts/python.exe tools/test_layout.py: ok: 59 checks.
  • tools/venv/Scripts/python.exe tools/game_sites.py find extracted/exefs/main: stale_actor_ai_msg: 0x7000bbb670.
  • git diff --check: clean.
  • Regenerated and rebuilt build/swgame.dll and build/savagewind.exe (make gen && make -j8, 1.9.0, 269 sites).
  • Unattended gameplay check (SAVAGEWIND_TEST_WARP=plateau, SAVAGEWIND_EXIT_AT=2400, 144 fps): reached frame 2242 cleanly with no crashes.

Checklist

  • Based on the latest test and opened against test
  • Built and run locally, and checked in the game
  • No game files, keys, firmware, generated game code or save files in the changes

Copilot AI balanced review requested due to automatic review settings November 26, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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