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

Method Load

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

Source from the content-addressed store, hash-verified

268EntityAITypePlain::~EntityAITypePlain() = default;
269
270int VehicleTypeBank::Load(const char* name)
271{
272 EntityType* type = nullptr;
273
274 if ((Pars >> "CfgVehicles").FindEntry(name))
275 {
276 const ParamEntry& cfg = Pars >> "CfgVehicles" >> name;
277 if ((cfg >> "scope").GetInt() > 0)
278 {
279 // LOG_DEBUG(Physics, "Preload {}",(const char *)name);
280 RString simulation = cfg >> "simulation";
281 const ParamEntry* par = &cfg;
282 simulation.Lower();
283 if (!strcmp(simulation, "tank"))
284 {
285 type = new TankType(par);
286 }
287 else if (!strcmp(simulation, "zsu"))
288 {
289 type = new TankType(par);
290 }
291 else if (!strcmp(simulation, "car"))
292 {
293 type = new CarType(par);
294 }
295 else if (!strcmp(simulation, "motorcycle"))
296 {
297 type = new MotorcycleType(par);
298 }
299 else if (!strcmp(simulation, "ship"))
300 {
301 type = new ShipType(par);
302 }
303 else if (!strcmp(simulation, "soldierold"))
304 {
305 type = new ManType(par);
306 }
307 else if (!strcmp(simulation, "soldier"))
308 {
309 type = new ManType(par);
310 }
311 else if (!strcmp(simulation, "helicopter"))
312 {
313 type = new HelicopterType(par);
314 }
315 else if (!strcmp(simulation, "parachute"))
316 {
317 type = new ParachuteType(par);
318 }
319 else if (!strcmp(simulation, "airplane"))
320 {
321 type = new AirplaneType(par);
322 }
323 else if (!strcmp(simulation, "lasertarget"))
324 {
325 type = new LaserTargetType(par);
326 }
327 if (!strcmp(simulation, "house"))

Callers

nothing calls this directly

Calls 5

AddClass · 0.85
LowerMethod · 0.80
IsAbstractMethod · 0.80
FindEntryMethod · 0.45
GetIntMethod · 0.45

Tested by

no test coverage detected