Skip to content

Commit 5f1d47e

Browse files
revolucasXottab-DUTY
authored andcommitted
~ moved some consumables code out of eatable_item.cpp UseBy into inventory.cpp Eat()
1 parent e21a81f commit 5f1d47e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/xrGame/Inventory.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,9 @@ bool CInventory::Eat(PIItem pIItem)
10811081
pIItem->SetDropManual(true);
10821082
}
10831083

1084+
if (pItemToEat->IsUsingCondition() && Actor()->m_inventory == this)
1085+
CurrentGameUI()->GetActorMenu().RefreshConsumableCells();
1086+
10841087
return true;
10851088
}
10861089

src/xrGame/eatable_item.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ bool CEatableItem::UseBy(CEntityAlive* entity_alive)
138138
m_iRemainingUses = 0;
139139

140140
SetCondition((float)m_iRemainingUses / (float)m_iMaxUses);
141-
if (IsUsingCondition())
142-
CurrentGameUI()->GetActorMenu().RefreshConsumableCells();
143141

144142
return true;
145143
}

0 commit comments

Comments
 (0)