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

Function HasWeapon

TombEngine/Game/pickup/pickup_weapon.cpp:113–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113std::optional<bool> HasWeapon(LaraInfo& lara, GAME_OBJECT_ID objectID)
114{
115 int arrPos = GetArraySlot(kWeapons, objectID);
116 if (-1 == arrPos)
117 return std::nullopt;
118
119 auto weaponPickup = kWeapons[arrPos];
120 return lara.Weapons[(int)weaponPickup.LaraWeaponType].Present;
121}

Callers 1

GetInventoryCountFunction · 0.85

Calls 1

GetArraySlotFunction · 0.85

Tested by

no test coverage detected