MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / agent_loadData

Function agent_loadData

TheForceEngine/TFE_DarkForces/agent.cpp:147–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 }
146
147 s32 agent_loadData()
148 {
149 FileStream file;
150 if (!openDarkPilotConfig(&file))
151 {
152 TFE_System::logWrite(LOG_ERROR, "Agent", "Cannot open DarkPilo.cfg");
153 return 0;
154 }
155
156 s32 agentReadCount = 0;
157 for (s32 i = 0; i < MAX_AGENT_COUNT; i++)
158 {
159 LevelSaveData saveData;
160 if (agent_readConfigData(&file, i, &saveData))
161 {
162 memcpy(&s_agentData[i], &saveData.agentData, sizeof(AgentData));
163 agentReadCount++;
164 }
165 }
166
167 file.close();
168 return agentReadCount;
169 }
170
171 void agent_levelComplete()
172 {

Callers 2

loadReplayWrapperFunction · 0.85
loadAgentAndLevelDataFunction · 0.85

Calls 4

openDarkPilotConfigFunction · 0.85
logWriteFunction · 0.85
agent_readConfigDataFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected