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

Function GetInventoryCount

TombEngine/Game/pickup/pickup.cpp:176–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176int GetInventoryCount(GAME_OBJECT_ID objectID)
177{
178 auto boolResult = HasWeapon(Lara, objectID);
179 if (boolResult.has_value())
180 return int{ boolResult.value() };
181
182 auto intResult = GetAmmoCount(Lara, objectID);
183 if (intResult.has_value())
184 return intResult.value();
185
186 intResult = GetKeyItemCount(Lara, objectID);
187 if (intResult.has_value())
188 return intResult.value();
189
190 intResult = GetConsumableCount(Lara, objectID);
191 if (intResult.has_value())
192 return intResult.value();
193
194 boolResult = HasMiscItem(Lara, objectID);
195 if (boolResult.has_value())
196 return int{ boolResult.value() };
197
198 return 0;
199}
200
201void RemoveObjectFromInventory(GAME_OBJECT_ID objectID, std::optional<int> count)
202{

Callers 2

IsObjectInInventoryMethod · 0.85
GetItemCountFunction · 0.85

Calls 7

HasWeaponFunction · 0.85
GetAmmoCountFunction · 0.85
GetKeyItemCountFunction · 0.85
GetConsumableCountFunction · 0.85
HasMiscItemFunction · 0.85
has_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected