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

Method SaveWeaponPool

engine/Poseidon/UI/OptionsUI.cpp:1182–1203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1180
1181void MissionHistory::AddMagazines(RString name, int count)
1182{
1183 for (int j = 0; j < magazines.Size(); j++)
1184 {
1185 if (stricmp(magazines[j].name, name) == 0)
1186 {
1187 magazines[j].count += count;
1188 if (magazines[j].count <= 0)
1189 {
1190 magazines.Delete(j);
1191 }
1192 return;
1193 }
1194 }
1195 if (count <= 0)
1196 {
1197 return;
1198 }
1199 int index = magazines.Add();
1200 magazines[index].name = name;
1201 magazines[index].count = count;
1202}
1203
1204void CampaignHistory::SaveWeaponPool(WeaponsInfo& pool)
1205{
1206 MissionHistory* mh = CurrentMission();

Callers 1

CampaignSaveWeaponPoolFunction · 0.80

Calls 5

AddWeaponsMethod · 0.80
AddMagazinesMethod · 0.80
ClearMethod · 0.45
SizeMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected