diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index 06e4e9d5b..fbea5db6c 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -1,4 +1,6 @@ ## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-1.0.1...develop) - ××××-××-×× +- fixed guns carried by enemies not being converted to ammo if Lara has picked up the same gun elsewhere in the same level (#2856) +- fixed guns carried by enemies not being converted to ammo if Lara starts the level with the gun and the game has later been reloaded (#2850, regression from 1.0) ## [1.0.1](https://github.com/LostArtefacts/TRX/compare/tr2-1.0...tr2-1.0.1) - 2025-04-24 - added an option to wraparound when scrolling UI dialogs, such as save/load (#2834) diff --git a/docs/tr2/README.md b/docs/tr2/README.md index 9faec4fd4..d0fe8a2f2 100644 --- a/docs/tr2/README.md +++ b/docs/tr2/README.md @@ -254,6 +254,7 @@ However, you can easily download them manually from these urls: - fixed Floating Islands mystic plaque inventory rotation - fixed pushblocks being rotated when Lara grabs them, most noticeable if asymmetric textures have been used - fixed being able to use hotkeys in the end-level statistics screen +- fixed guns carried by enemies not being converted to ammo if Lara has picked up the same gun elsewhere in the same level - fixed destroyed gondolas appearing embedded in the ground after loading a save - improved the animation of Lara's braid diff --git a/src/libtrx/game/items.c b/src/libtrx/game/items.c index a2698b37b..f92b67299 100644 --- a/src/libtrx/game/items.c +++ b/src/libtrx/game/items.c @@ -219,15 +219,11 @@ int32_t Item_GlobalReplace( { int32_t changed = 0; - for (int32_t i = 0; i < Room_GetCount(); i++) { - int16_t item_num = Room_Get(i)->item_num; - while (item_num != NO_ITEM) { - ITEM *const item = &m_Items[item_num]; - if (item->object_id == src_obj_id) { - item->object_id = dst_obj_id; - changed++; - } - item_num = item->next_item; + for (int32_t item_num = 0; item_num < m_MaxUsedItemCount; item_num++) { + ITEM *const item = &m_Items[item_num]; + if (item->object_id == src_obj_id) { + item->object_id = dst_obj_id; + changed++; } }