Skip to content

Commit 6cebfa2

Browse files
gunslingermodXottab-DUTY
authored andcommitted
[Bugfix] Removed flickering after game item usage
When you use eatable item (such as medkit) with pistol in actor's hands, you can see as used item flickers on the screen. It happens because the game drops used item from actor's inventory before removing it. Such bug seriously affects game experience when hud scheme for usable items (such as 'gwr_eatable.script') is installed. The fix is hiding dropped item, so you will never see it.
1 parent 5e59f8f commit 6cebfa2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/xrGame/eatable_item_object.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ void CEatableItemObject::OnH_A_Independent()
6060
{
6161
CEatableItem::OnH_A_Independent();
6262
CPhysicItem::OnH_A_Independent();
63+
// If we are dropping used item before removing - don't show it
64+
if (!Useful())
65+
{
66+
setVisible(false);
67+
setEnabled(false);
68+
}
6369
}
6470

6571
void CEatableItemObject::OnH_B_Independent(bool just_before_destroy)

0 commit comments

Comments
 (0)