tr2/inventory: fix flare pickup quantity
Some checks failed
Publish a pre-release / Build TR1 (push) Has been skipped
Publish a pre-release / Build TR2 (push) Has been skipped
Publish a pre-release / Create a prerelease (push) Has been skipped
Run code linters / Run code linters (push) Has been cancelled

This ensures we always add 6 flares when Lara picks up item 151. The
other logic for single flares is required for gameflow flare additions,
like in Great Wall.

Resolves #2551.
This commit is contained in:
lahm86 2025-02-25 12:40:09 +00:00
parent b1e24182fc
commit f98d5a3574
2 changed files with 4 additions and 1 deletions

View file

@ -3,6 +3,7 @@
- added a `/wireframe` console command (#2500)
- fixed smashed windows blocking enemy pathing after loading a save (#2535)
- fixed a rare issue whereby Lara would be unable to move after disposing a flare (#2545, regression from 0.9)
- fixed flare pickups only adding one flare to Lara's inventory rather than six (#2551, regression from 0.9)
## [0.9.2](https://github.com/LostArtefacts/TRX/compare/tr2-0.9.1...tr2-0.9.2) - 2025-02-19
- fixed secret rewards not handed out after loading a save (#2528, regression from 0.8)

View file

@ -18,7 +18,9 @@ bool Inv_AddItem(const GAME_OBJECT_ID obj_id)
INV_RING_SOURCE *const source = &g_InvRing_Source[ring_type];
for (int32_t i = 0; i < source->count; i++) {
if (source->items[i]->object_id == inv_obj_id) {
source->qtys[i]++;
const int32_t qty =
obj_id == O_FLARES_ITEM ? FLARE_AMMO_QTY : 1;
source->qtys[i] += qty;
return true;
}
}