Skip to content

Commit

Permalink
[Bugfix] Removed flickering after game item usage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gunslingermod authored and Xottab-DUTY committed Aug 14, 2017
1 parent 5e59f8f commit 6cebfa2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/xrGame/eatable_item_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ void CEatableItemObject::OnH_A_Independent()
{
CEatableItem::OnH_A_Independent();
CPhysicItem::OnH_A_Independent();
// If we are dropping used item before removing - don't show it
if (!Useful())
{
setVisible(false);
setEnabled(false);
}
}

void CEatableItemObject::OnH_B_Independent(bool just_before_destroy)
Expand Down

0 comments on commit 6cebfa2

Please sign in to comment.