MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / AttachMagazine

Method AttachMagazine

engine/Poseidon/AI/VehicleAI.cpp:2160–2175  ·  view source on GitHub ↗

! \param muzzle muzzle where magazine will be attached \param magazine attached magazine */

Source from the content-addressed store, hash-verified

2158\param magazine attached magazine
2159*/
2160void EntityAI::AttachMagazine(const MuzzleType* muzzle, Magazine* magazine)
2161{
2162 if (!muzzle->CanUse(magazine->_type))
2163 {
2164 RptF("Cannot use magazine %s in muzzle %s", (const char*)magazine->_type->GetName(),
2165 (const char*)muzzle->GetName());
2166 return;
2167 }
2168 for (int i = 0; i < _magazineSlots.Size(); i++)
2169 {
2170 if (_magazineSlots[i]._muzzle == muzzle)
2171 {
2172 _magazineSlots[i]._magazine = magazine;
2173 }
2174 }
2175}
2176
2177const MagazineSlot* EntityAI::GetmagazineSlotByMuzzle(const RString& name) const
2178{

Callers 3

AUTO_STATIC_ARRAYFunction · 0.80
SimulateMethod · 0.80
ObjFireExFunction · 0.80

Calls 3

CanUseMethod · 0.80
GetNameMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected