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

Method InitCenter

engine/Poseidon/World/WorldInit.cpp:415–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413 }
414}
415void World::InitCenter(AICenterMode mode, AICenter* cnt)
416{
417 for (int i = 0; i < cnt->NGroups(); i++)
418 {
419 AIGroup* grp = cnt->GetGroup(i);
420 if (!grp)
421 {
422 continue;
423 }
424 for (int j = 0; j < MAX_UNITS_PER_GROUP; j++)
425 {
426 AIUnit* unit = grp->UnitWithID(j + 1);
427 if (!unit)
428 {
429 continue;
430 }
431 unit->GetPerson()->GetInfo()._initExperience = unit->GetPerson()->GetInfo()._experience;
432 if (unit->IsFreeSoldier())
433 {
434 unit->GetPerson()->ResetMovement(0);
435 }
436 if (unit->IsUnit())
437 {
438 unit->GetVehicle()->AutoReloadAll();
439 }
440 }
441 grp->GetRadio().SilentProcess();
442 }
443 if (mode == AICMNetwork)
444 {
445 GetNetworkManager().CreateCenter(cnt);
446 }
447}
448bool World::InitVehicles(GameMode gameMode, ArcadeTemplate& t)
449{
450 DWORD tInitVehicles = GetTickCount();

Callers

nothing calls this directly

Calls 11

NGroupsMethod · 0.80
UnitWithIDMethod · 0.80
GetPersonMethod · 0.80
IsFreeSoldierMethod · 0.80
IsUnitMethod · 0.80
AutoReloadAllMethod · 0.80
SilentProcessMethod · 0.80
GetGroupMethod · 0.45
ResetMovementMethod · 0.45
GetVehicleMethod · 0.45
CreateCenterMethod · 0.45

Tested by

no test coverage detected