MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / SaveVariablesToFile

Method SaveVariablesToFile

src/Ext/Scenario/Body.cpp:63–78  ·  view source on GitHub ↗

you've inspired something controversial

Source from the content-addressed store, hash-verified

61
62// you've inspired something controversial
63void ScenarioExt::ExtData::SaveVariablesToFile(bool isGlobal)
64{
65 CCINIClass fINI {};
66 CCFileClass file { isGlobal ? "globals.ini" : "locals.ini" };
67
68 if (file.Exists())
69 fINI.ReadCCFile(&file);
70 else
71 file.CreateFileA();
72
73 for (const auto& [_,varext] : Global()->Variables[isGlobal])
74 fINI.WriteInteger(ScenarioClass::Instance->FileName, varext.Name, varext.Value, false);
75
76 fINI.WriteCCFile(&file);
77 file.Close();
78}
79
80void ScenarioExt::Allocate(ScenarioClass* pThis)
81{

Callers

nothing calls this directly

Calls 1

ExistsMethod · 0.80

Tested by

no test coverage detected