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

Method AddMagazines

engine/Poseidon/UI/OptionsUI.cpp:1159–1180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1157
1158void MissionHistory::AddWeapons(RString name, int count)
1159{
1160 for (int j = 0; j < weapons.Size(); j++)
1161 {
1162 if (stricmp(weapons[j].name, name) == 0)
1163 {
1164 weapons[j].count += count;
1165 if (weapons[j].count <= 0)
1166 {
1167 weapons.Delete(j);
1168 }
1169 return;
1170 }
1171 }
1172 if (count <= 0)
1173 {
1174 return;
1175 }
1176 int index = weapons.Add();
1177 weapons[index].name = name;
1178 weapons[index].count = count;
1179}
1180
1181void MissionHistory::AddMagazines(RString name, int count)
1182{
1183 for (int j = 0; j < magazines.Size(); j++)

Callers 3

SaveWeaponPoolMethod · 0.80
PoolAddMagazineFunction · 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