MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetConsumableCount

Function GetConsumableCount

TombEngine/Game/pickup/pickup_consumable.cpp:79–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79std::optional<int> GetConsumableCount(LaraInfo& lara, GAME_OBJECT_ID objectID)
80{
81 int arrayPos = GetArraySlot(Consumables, objectID);
82 if (arrayPos == NO_VALUE)
83 return std::nullopt;
84
85 const auto& consumable = Consumables[arrayPos];
86
87 return lara.Inventory.*(consumable.Count);
88}
89
90int GetDefaultConsumableCount(GAME_OBJECT_ID objectID)
91{

Callers 1

GetInventoryCountFunction · 0.85

Calls 1

GetArraySlotFunction · 0.85

Tested by

no test coverage detected