* Fix crash due to corrupted `whoHitMe`
It's possible for some object's `whoHitMe` to contain `-1`. It's supposed to be resolved to `nullptr`, but doesn't reliably happen in all cases, esp outside of combat. The main fix here is to normalize to nullptr when loading the object, instead of just map load, or combat paths.
At some point I thought the problem might have been attacker being a non-critter. Added some guards against that regardless. Also, found several bugs and messiness in `apply_damage` which are now fixed.
Fixes https://github.com/alexbatalov/fallout2-ce/issues/368
* Fix ddraw.ini -> game.cfg migration on unix-y systems
We were using `compat_splitpath` on a windows path. We want to work on windows paths, so that's good. This fixes compat_splitpath so that it works with both folder separators. Also tweak `compat_makepath` to recognize both, for consistency.
This means that filenames with `\` will be broken, but I think we can (and should) live with that)
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* chore: auto-format with clang-format
* fix
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Better fix for directory detection
A couple places we used compat_file_exists to distinguish between files and folders/dirs, but this breaks on POSIX. This attempts to fix it more holistically
* Make compat_file_exists to be consistent
All platforms now return false for folders/dirs
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Most are of this type
```
warning: 'size' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
sfall_arrays.cc:313:26: note: overridden virtual function is here
313 | virtual ProgramValue GetArrayKey(int index, Program* program) = 0;
|
```