MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / getWeapon

Method getWeapon

source/gamemap/GameMap.cpp:416–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416const Weapon* GameMap::getWeapon(int index)
417{
418 if(index >= static_cast<int>(mWeapons.size()))
419 {
420 OD_LOG_ERR("index=" + Helper::toString(index));
421 return nullptr;
422 }
423
424 std::pair<const Weapon*,Weapon*>& def = mWeapons[index];
425 if(def.second != nullptr)
426 return def.second;
427
428 return def.first;
429}
430
431const Weapon* GameMap::getWeapon(const std::string& name)
432{

Callers 6

CreatureMethod · 0.45
importFromStreamMethod · 0.45
importFromPacketMethod · 0.45
updateMethod · 0.45
writeWeaponDiffMethod · 0.45

Calls 1

toStringFunction · 0.50

Tested by

no test coverage detected