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

Method Preload

engine/Poseidon/World/Entities/Vehicles/VehicleTypes.cpp:164–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162void GlobalAlive();
163
164void VehicleTypeBank::Preload()
165{
166 static const char* names[] = {"CfgVehicles", "CfgAmmo", "CfgNonAIVehicles"};
167 for (int n = 0; n < sizeof(names) / sizeof(*names); n++)
168 {
169 const char* name = names[n];
170 const ParamEntry& vehicles = Pars >> name;
171 for (int i = 0; i < vehicles.GetEntryCount(); i++)
172 {
173 I_AM_ALIVE(); // this loop can take quite long
174 const ParamEntry& entry = vehicles.GetEntry(i);
175 const ParamClass* eClass = dynamic_cast<const ParamClass*>(&entry);
176 if (!eClass)
177 {
178 continue;
179 }
180 if (entry.FindEntry("vehicleClass"))
181 {
182 RString vehClass = entry >> "vehicleClass";
183 if (stricmp(vehClass, "Sounds") == 0)
184 {
185 continue;
186 }
187 if (stricmp(vehClass, "Mines") == 0)
188 {
189 continue;
190 }
191 }
192 New(entry.GetName());
193 }
194 }
195 if (GSoundsys)
196 {
197 GSoundsys->FlushBank(nullptr);
198 }
199 GFileServer->FlushBank(nullptr);
200}
201
202int VehicleTypeBank::AuditEditorVisibleModels() const
203{

Callers 3

InitEditorMethod · 0.45
InitVehiclesMethod · 0.45
SerializeMethod · 0.45

Calls 5

stricmpFunction · 0.50
GetEntryCountMethod · 0.45
FindEntryMethod · 0.45
GetNameMethod · 0.45
FlushBankMethod · 0.45

Tested by

no test coverage detected