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

Method AddMission

engine/Poseidon/UI/OptionsUI.cpp:980–1012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

978 ParamArchive arSubcls;
979 if (!ar.OpenSubclass("Stats", arSubcls))
980 {
981 return LSStructure;
982 }
983 stats.CampaignSerialize(arSubcls);
984 }
985 else if (ar.IsLoading())
986 {
987 stats.Clear();
988 }
989 PARAM_CHECK(ar.Serialize("Weapons", weapons, 1))
990 PARAM_CHECK(ar.Serialize("Magazines", magazines, 1))
991 PARAM_CHECK(ar.SerializeArray("Dead", dead, 1))
992 return LSOK;
993}
994
995LSError BattleHistory::Serialize(ParamArchive& ar)
996{
997 PARAM_CHECK(ar.Serialize("battleName", battleName, 1))
998 PARAM_CHECK(ar.Serialize("Missions", missions, 1))
999 return LSOK;
1000}
1001
1002void CampaignHistory::AddMission(RString campaign, RString battle, RString mission, RString displayName)
1003{
1004 if (!campaign || campaign.GetLength() <= 0)
1005 {
1006 return;
1007 }
1008 if (stricmp(campaign, campaignName) != 0)
1009 {
1010 return;
1011 }
1012 int i = battles.Size() - 1;
1013 if (i < 0 || stricmp(battles[i].battleName, battle) != 0)
1014 {
1015 i = battles.Add();

Callers 1

AddMissionFunction · 0.80

Calls 4

stricmpFunction · 0.50
GetLengthMethod · 0.45
SizeMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected