* Fix elevator cancelation in RPU
If you step into an elevator in RPU and cancel the floor selection, the door closes behind you (sometimes with glitchy graphics). This is a latent bug in the elevators code that vanilla doesn't hit
- elevator_select_ mutates the caller’s elevation to a UI/display level before the modal loop.
- Escape/cancel returns 0 without writing a destination tile.
- Caller then sees map == current map and elevation != current elevation, so it closes the nearby door.
- tile is still -1.
* NovaRains approach
* dont default to first floor if not found
* We call skillGetValue(gDude, SKILL_SNEAK) for every target
* For non-critters, that can result in OOB memory reads
* We only need it for gDude for sneaking
So let's only call it when dude is sneaking and is the target
* Fix out-of-bounds write in wmWorldMap_load when numCities exceeds wmMaxAreaNum
* use ENTRANCE_LIST_CAPACITY to properly isolate city entrances
And read a rest to dummy struct
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* adds debug print warning regarding extra data in .sav
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Correct `get_object_data` indexes
Currently they are raw offset pointers. This does not work with CE since pointers are wide (64bit) on some (most) platforms. So, we can treat these offsets like constants and return the appropriate fields instead.
There are already used for the most part as enum constants:
* Sfall fix for > 160 maps for automap code (RPU triggers this)
* Logic fix for action menu, where actionIndex was incremented unconditionally and could go out of bounds. This was a regression from vanilla
Add equipment slots to the companion loot screen.
Items can be equipped directly from player or companion inventory. This also allows switching between party members so you can manage all companion's inventories easily. Does not allow equipping items that would otherwise be disallowed.
Also:
Calls HOOK_UNWIELD when adding/removing equipment, meaning mods like npc armor work
Uses HOOK_CANUSE for weapon use checks
Ctrl-click to equip is not implemented since it already transfers items between the two inventories. I tried making it work only for equippable items (and otherwise transfer), but that felt awkward and random. Ctrl-click unequip is implemented.