* Implement HOOK_CALCAPCOST
An opcode a day keeps the stimpak away.
https://sfall-team.github.io/sfall/hook-types/#calcapcost
Same as Sfall, but also calls the hook on game load to display the correct AP cost on load.
Also fix a minor bug where the attack mode of the current hand sometimes leaked when loading a save game. Normally attack mode (burst/reload/&c) isn't saved. But if you are in aimed mode (say), and load a game with the same weapon equipped, the attack mode will persist. This is pretty weird, so changed it to always be in the default mode when loading a save.
* test script
* PR comments
* doc tweaks
* Retain key§ions comments when overwriting fallout2.cfg
- Vibe coded with human review and testing
* Fix anim_speed key name
* Revert comment removal by Gemini
* Handle final remove/rename failures
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix edge case when filePath is near MAX_PATH
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Remove dead weight
* Vibe coded bug fixes and new write flag
* Comment for config flags
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix garbled splash screen when `SkipOpeningMovies=1`
If the splash screen is shown but movies are skipped, the main menu palette is applied to the splash screen for a split second, showing garbled colours. This doesn't happen with movies since they clear the screen.
Fix is to force a black screen clear beforing fading in the main menu
* simplify
* chore: auto-format with clang-format
* Restore palette before load-list error dialog
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Implement sfall `signal_close_game`
Used by Et tu, but might be useful for LLMs too to quit the game after running a test case.
Also added enum for `_user_wants_to_quit`, and did minor reformatting of SFALL_COMPATIBILITY.md
* Moved f2_res.ini settings into regular game config
* Rename resolution fields
* chore: auto-format with clang-format
* Code review fixes
* chore: auto-format with clang-format
* One-time migration of f2_res.ini to fallout2.cfg (#350)
* One-time migration of f2_res.ini to fallout2.cfg
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mike Klaas <mike.klaas@gmail.com>
Saw a crash while testing gl_ShowLootWeight. The issue was that the script uses `repeat(1)`, and we tried to spawn it again while it was running.
The fix is to check if the program is already running, using the same logic as the game does when running scripts.
This doesn't happen with Sfall since its global script implementation is more integrated with the interpreter. This does point to likely other subtle differences that might matter.