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

Method AddWeapons

engine/Poseidon/UI/OptionsUI.cpp:1136–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1134 for (int i = 0; i < mh->magazines.Size(); i++)
1135 {
1136 Ref<MagazineType> type = MagazineTypes.New(mh->magazines[i].name);
1137 if (!type)
1138 {
1139 continue;
1140 }
1141 int count = mh->magazines[i].count;
1142 for (int j = 0; j < count; j++)
1143 {
1144 Ref<Magazine> magazine = new Magazine(type);
1145 magazine->_ammo = type->_maxAmmo;
1146 magazine->_reloadMagazine = 0;
1147 magazine->_reload = 0;
1148 if (type->_modes.Size() > 0)
1149 {
1150 float reload = 0.8 + 0.2 * GRandGen.RandomValue();
1151 magazine->_reload = reload * type->_modes[0]->_reloadTime;
1152 }
1153 pool._magazinesPool.Add(magazine);
1154 }
1155 }
1156}
1157
1158void MissionHistory::AddWeapons(RString name, int count)
1159{
1160 for (int j = 0; j < weapons.Size(); j++)

Callers 3

SaveWeaponPoolMethod · 0.80
PoolAddWeaponFunction · 0.80
PoolSetWeaponsFunction · 0.80

Calls 4

stricmpFunction · 0.50
SizeMethod · 0.45
DeleteMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected