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

Function PoolAddMagazine

engine/Poseidon/UI/OptionsUI.cpp:1290–1316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1288 {
1289 return GameValue();
1290 }
1291
1292 RString name = array[0];
1293 int count = toInt((float)array[1]);
1294
1295 int i = GetGCampaignHistory().battles.Size() - 1;
1296 if (i < 0)
1297 {
1298 return GameValue();
1299 }
1300 BattleHistory& bh = GetGCampaignHistory().battles[i];
1301 i = bh.missions.Size() - 1;
1302 if (i < 0)
1303 {
1304 return GameValue();
1305 }
1306 MissionHistory& mh = bh.missions[i];
1307 mh.AddWeapons(name, count);
1308
1309 return GameValue();
1310}
1311
1312GameValue PoolAddMagazine(const GameState* state, GameValuePar oper1)
1313{
1314 const GameArrayType& array = oper1;
1315 if (array.Size() != 2 || array[0].GetType() != GameString || array[1].GetType() != GameScalar)
1316 {
1317 return GameValue();
1318 }
1319

Callers

nothing calls this directly

Calls 5

AddMagazinesMethod · 0.80
GameValueClass · 0.50
toIntFunction · 0.50
SizeMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected