diff options
Diffstat (limited to 'src/peds/Population.cpp')
-rw-r--r-- | src/peds/Population.cpp | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index cd89a05d..1566ba3d 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -396,7 +396,7 @@ CPopulation::FindCollisionZoneForCoors(CVector *coors, int *safeZoneOut, eLevelN if (*safeZoneOut >= 0) *levelOut = LEVEL_NONE; else - *levelOut = CTheZones::GetLevelFromPosition(*coors); + *levelOut = CTheZones::GetLevelFromPosition(coors); } void @@ -495,7 +495,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors) case PEDTYPE_CIVFEMALE: { CCivilianPed *ped = new CCivilianPed(pedType, miOrCopType); - ped->GetPosition() = coors; + ped->SetPosition(coors); ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); if (ms_bGivePedsWeapons) { @@ -509,7 +509,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors) case PEDTYPE_COP: { CCopPed *ped = new CCopPed((eCopType)miOrCopType); - ped->GetPosition() = coors; + ped->SetPosition(coors); ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); return ped; @@ -525,7 +525,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors) case PEDTYPE_GANG9: { CCivilianPed *ped = new CCivilianPed(pedType, miOrCopType); - ped->GetPosition() = coors; + ped->SetPosition(coors); ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); @@ -540,7 +540,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors) case PEDTYPE_EMERGENCY: { CEmergencyPed *ped = new CEmergencyPed(PEDTYPE_EMERGENCY); - ped->GetPosition() = coors; + ped->SetPosition(coors); ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); return ped; @@ -548,7 +548,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors) case PEDTYPE_FIREMAN: { CEmergencyPed *ped = new CEmergencyPed(PEDTYPE_FIREMAN); - ped->GetPosition() = coors; + ped->SetPosition(coors); ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); return ped; @@ -557,7 +557,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors) case PEDTYPE_PROSTITUTE: { CCivilianPed *ped = new CCivilianPed(pedType, miOrCopType); - ped->GetPosition() = coors; + ped->SetPosition(coors); ped->SetOrientation(0.0f, 0.0f, 0.0f); CWorld::Add(ped); return ped; @@ -755,7 +755,7 @@ CPopulation::AddPedInCar(CVehicle* car) int preferredModel; CTheZones::GetZoneInfoForTimeOfDay(&coors, &zoneInfo); - switch (car->m_modelIndex) { + switch (car->GetModelIndex()) { case MI_FIRETRUCK: preferredModel = 0; pedType = PEDTYPE_FIREMAN; @@ -796,14 +796,14 @@ CPopulation::AddPedInCar(CVehicle* car) int gangOfPed = 0; imSureThatModelIsLoaded = false; - while (gangOfPed < NUM_GANGS && CGangs::GetGangInfo(gangOfPed)->m_nVehicleMI != car->m_modelIndex) + while (gangOfPed < NUM_GANGS && CGangs::GetGangInfo(gangOfPed)->m_nVehicleMI != car->GetModelIndex()) gangOfPed++; if (gangOfPed < NUM_GANGS) { pedType = gangOfPed + PEDTYPE_GANG1; preferredModel = ChooseGangOccupation(gangOfPed); } else if (gangOfPed == NUM_GANGS) { - CVehicleModelInfo *carModelInfo = ((CVehicleModelInfo*)CModelInfo::GetModelInfo(car->m_modelIndex)); + CVehicleModelInfo *carModelInfo = ((CVehicleModelInfo *)CModelInfo::GetModelInfo(car->GetModelIndex())); int i = 15; for(; i >= 0; i--) { // Should return random model each time @@ -869,8 +869,8 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones() CVehicle* veh = CPools::GetVehiclePool()->GetSlot(poolIndex); if (veh && veh->m_nZoneLevel == LEVEL_NONE && veh->IsCar()) { - if(veh->m_status != STATUS_ABANDONED && veh->m_status != STATUS_WRECKED && veh->m_status != STATUS_PLAYER && - veh->m_status != STATUS_PLAYER_REMOTE) { + if(veh->GetStatus() != STATUS_ABANDONED && veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_PLAYER && + veh->GetStatus() != STATUS_PLAYER_REMOTE) { CVector vehPos(veh->GetPosition()); CPopulation::FindCollisionZoneForCoors(&vehPos, &zone, &level); @@ -880,22 +880,22 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones() if (veh->bIsLocked || !veh->CanBeDeleted()) { switch (movedVehicleCount & 3) { case 0: - veh->GetPosition() = RegenerationPoint_a; + veh->SetPosition(RegenerationPoint_a); break; case 1: - veh->GetPosition() = RegenerationPoint_b; + veh->SetPosition(RegenerationPoint_b); break; case 2: - veh->GetPosition() = CVector(RegenerationPoint_a.x, RegenerationPoint_b.y, RegenerationPoint_a.z); + veh->SetPosition(RegenerationPoint_a.x, RegenerationPoint_b.y, RegenerationPoint_a.z); break; case 3: - veh->GetPosition() = CVector(RegenerationPoint_b.x, RegenerationPoint_a.y, RegenerationPoint_a.z); + veh->SetPosition(RegenerationPoint_b.x, RegenerationPoint_a.y, RegenerationPoint_a.z); break; default: break; } - veh->GetPosition().z += (movedVehicleCount / 4) * 7.0f; - veh->GetForward() = RegenerationForward; + veh->GetMatrix().GetPosition().z += (movedVehicleCount / 4) * 7.0f; + veh->GetMatrix().GetForward() = RegenerationForward; ((CAutomobile*)veh)->PlaceOnRoadProperly(); CCarCtrl::JoinCarWithRoadSystem(veh); CTheScripts::ClearSpaceForMissionEntity(veh->GetPosition(), veh); @@ -924,14 +924,14 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones() CWorld::Remove(ped); delete ped; } else if (ped->m_nPedType != PEDTYPE_PLAYER1 && ped->m_nPedType != PEDTYPE_PLAYER2) { - ped->GetPosition() = RegenerationPoint_a; + ped->SetPosition(RegenerationPoint_a); bool foundGround; float groundZ = CWorld::FindGroundZFor3DCoord(ped->GetPosition().x, ped->GetPosition().y, ped->GetPosition().z + 2.0f, &foundGround); if (foundGround) { - ped->GetPosition().z = 1.0f + groundZ; + ped->GetMatrix().GetPosition().z = 1.0f + groundZ; //ped->GetPosition().z += 0.0f; CTheScripts::ClearSpaceForMissionEntity(ped->GetPosition(), ped); } @@ -970,7 +970,7 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy) CWorld::Remove(dummy); delete dummy; CWorld::Add(obj); - int16 mi = obj->m_modelIndex; + int16 mi = obj->GetModelIndex(); if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 || mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8) makeInvisible = true; @@ -979,7 +979,7 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy) if (makeInvisible) { obj->bIsVisible = false; - } else if (obj->m_modelIndex == MI_BUOY) { + } else if (obj->GetModelIndex() == MI_BUOY) { obj->bIsStatic = false; obj->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.001f); obj->bTouchingWater = true; @@ -997,7 +997,7 @@ CPopulation::ConvertToDummyObject(CObject *obj) dummy->UpdateRwFrame(); bool makeInvisible; - int16 mi = obj->m_modelIndex; + int16 mi = obj->GetModelIndex(); if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 || mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8) makeInvisible = true; @@ -1017,8 +1017,7 @@ bool CPopulation::TestRoomForDummyObject(CObject *obj) { int16 collidingObjs; - CWorld::FindObjectsKindaColliding(obj->m_objectMatrix.GetPosition(), - CModelInfo::GetModelInfo(obj->m_modelIndex)->GetColModel()->boundingSphere.radius, + CWorld::FindObjectsKindaColliding(obj->m_objectMatrix.GetPosition(), CModelInfo::GetModelInfo(obj->GetModelIndex())->GetColModel()->boundingSphere.radius, false, &collidingObjs, 2, nil, false, true, true, false, false); return collidingObjs == 0; |