diff options
Diffstat (limited to '')
-rw-r--r-- | src/peds/EmergencyPed.cpp | 2 | ||||
-rw-r--r-- | src/peds/Ped.cpp | 46 | ||||
-rw-r--r-- | src/peds/Ped.h | 2 | ||||
-rw-r--r-- | src/peds/PedAI.cpp | 20 | ||||
-rw-r--r-- | src/peds/PedFight.cpp | 22 | ||||
-rw-r--r-- | src/peds/PedIK.h | 2 | ||||
-rw-r--r-- | src/peds/PlayerPed.cpp | 77 | ||||
-rw-r--r-- | src/peds/PlayerPed.h | 9 | ||||
-rw-r--r-- | src/peds/Population.cpp | 7 |
9 files changed, 150 insertions, 37 deletions
diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp index d8c8309e..6a5ca25b 100644 --- a/src/peds/EmergencyPed.cpp +++ b/src/peds/EmergencyPed.cpp @@ -212,7 +212,7 @@ CEmergencyPed::MedicAI(void) if (!waitUntilMedicEntersCar) { CCarCtrl::JoinCarWithRoadSystem(m_pMyVehicle); m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE; - m_pMyVehicle->m_bSirenOrAlarm = 0; + m_pMyVehicle->m_bSirenOrAlarm = false; m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 12; m_pMyVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_SLOW_DOWN_FOR_CARS; if (m_pMyVehicle->bIsAmbulanceOnDuty) { diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 5b52d021..6b28dcb0 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -326,6 +326,7 @@ CPed::~CPed(void) nearPed->m_nearPeds[k] = nearPed->m_nearPeds[k + 1]; nearPed->m_nearPeds[k + 1] = nil; } + nearPed->m_nearPeds[ARRAY_SIZE(m_nearPeds) - 1] = nil; nearPed->m_numNearPeds--; } else j++; @@ -392,8 +393,20 @@ CPed::BuildPedLists(void) if (ped != this && !ped->bInVehicle) { float dist = (ped->GetPosition() - GetPosition()).Magnitude2D(); if (nThreatReactionRangeMultiplier * 30.0f > dist) { +#ifdef FIX_BUGS + // If the gap ped list is full, sort it and truncate it + // before pushing more unsorted peds + if( gnNumTempPedList == ARRAY_SIZE(gapTempPedList) - 1 ) + { + gapTempPedList[gnNumTempPedList] = nil; + SortPeds(gapTempPedList, 0, gnNumTempPedList - 1); + gnNumTempPedList = ARRAY_SIZE(m_nearPeds); + } +#endif + gapTempPedList[gnNumTempPedList] = ped; gnNumTempPedList++; + // NOTE: We cannot absolutely fill the gap list, as the list is null-terminated before being passed to SortPeds assert(gnNumTempPedList < ARRAY_SIZE(gapTempPedList)); } } @@ -1107,8 +1120,12 @@ CPed::ClearAimFlag(void) #endif } - if (IsPlayer()) + if (IsPlayer()) { ((CPlayerPed*)this)->m_fFPSMoveHeading = 0.0f; +#ifdef FREE_CAM + ((CPlayerPed*)this)->m_bFreeAimActive = false; +#endif + } } void @@ -1347,6 +1364,9 @@ CPed::CalculateNewVelocity(void) limitedRotDest -= 2 * PI; } +#ifdef FREE_CAM + if (!CCamera::bFreeCam || !TheCamera.Cams[0].Using3rdPersonMouseCam()) +#endif if (IsPlayer() && m_nPedState == PED_ATTACK) headAmount /= 4.0f; @@ -2292,7 +2312,7 @@ CPed::ProcessControl(void) } else { DMAudio.PlayOneShot(collidingVeh->m_audioEntityId, SOUND_CAR_PED_COLLISION, m_fDamageImpulse); if (IsPlayer()) { - CColModel *collidingCol = CModelInfo::GetModelInfo(collidingVeh->GetModelIndex())->GetColModel(); + CColModel *collidingCol = CModelInfo::GetColModel(collidingVeh->GetModelIndex()); CVector colMinVec = collidingCol->boundingBox.min; CVector colMaxVec = collidingCol->boundingBox.max; @@ -2473,12 +2493,12 @@ CPed::ProcessControl(void) obstacleForFlyingOtherDirZ = 501.0f; } #ifdef VC_PED_PORTS - uint8 flyDir = 0; + int16 flyDir = 0; float feetZ = GetPosition().z - FEET_OFFSET; #ifdef FIX_BUGS - if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) + if (obstacleForFlyingZ > feetZ && obstacleForFlyingZ < 500.0f) flyDir = 1; - else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f) + else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) flyDir = 2; #else if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ)) @@ -2487,8 +2507,8 @@ CPed::ProcessControl(void) flyDir = 2; #endif - if (flyDir != 0 && !bSomeVCflag1) { - SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); + if (flyDir > 0 && !bSomeVCflag1) { + GetMatrix().SetTranslateOnly((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); GetMatrix().GetPosition().z += FEET_OFFSET; GetMatrix().UpdateRW(); SetLanding(); @@ -3045,8 +3065,8 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints) CColPoint intersectionPoint; CColLine ourLine; - CColModel *ourCol = CModelInfo::GetModelInfo(GetModelIndex())->GetColModel(); - CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex())->GetColModel(); + CColModel *ourCol = CModelInfo::GetColModel(GetModelIndex()); + CColModel *hisCol = CModelInfo::GetColModel(collidingEnt->GetModelIndex()); if (!bUsesCollision) return 0; @@ -3187,7 +3207,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints) lowerSpeedLimit *= 1.5f; } CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); - if (!bWasStanding && speed > upperSpeedLimit && (/*!bPushedAlongByCar ||*/ m_vecMoveSpeed.z < lowerSpeedLimit) + if (!bWasStanding && ((speed > upperSpeedLimit /* ||!bPushedAlongByCar*/) || (m_vecMoveSpeed.z < lowerSpeedLimit)) && m_pCollidingEntity != collidingEnt) { float damage = 100.0f * Max(speed - 0.25f, 0.0f); @@ -3540,7 +3560,7 @@ void CPed::SetDirectionToWalkAroundObject(CEntity *obj) { float distLimitForTimer = 8.0f; - CColModel *objCol = CModelInfo::GetModelInfo(obj->GetModelIndex())->GetColModel(); + CColModel *objCol = CModelInfo::GetColModel(obj->GetModelIndex()); CVector objColMin = objCol->boundingBox.min; CVector objColMax = objCol->boundingBox.max; CVector objColCenter = (objColMin + objColMax) / 2.0f; @@ -4870,7 +4890,7 @@ CPed::PreRender(void) if (CWeather::Rain > 0.3f && TheCamera.SoundDistUp > 15.0f) { if ((TheCamera.GetPosition() - GetPosition()).Magnitude() < 25.0f) { bool doSplashUp = true; - CColModel *ourCol = CModelInfo::GetModelInfo(GetModelIndex())->GetColModel(); + CColModel *ourCol = CModelInfo::GetColModel(GetModelIndex()); CVector speed = FindPlayerSpeed(); if (Abs(speed.x) <= 0.05f && Abs(speed.y) <= 0.05f) { @@ -8028,7 +8048,7 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg) return; CVector forward(0.15f * ped->GetForward() + ped->GetPosition()); - forward.z += CModelInfo::GetModelInfo(ped->GetModelIndex())->GetColModel()->spheres->center.z + 0.25f; + forward.z += CModelInfo::GetColModel(ped->GetModelIndex())->spheres->center.z + 0.25f; CEntity *obstacle = CWorld::TestSphereAgainstWorld(forward, 0.25f, nil, true, true, false, true, false, false); if (!obstacle) { diff --git a/src/peds/Ped.h b/src/peds/Ped.h index 33839aa7..9cd85ef1 100644 --- a/src/peds/Ped.h +++ b/src/peds/Ped.h @@ -574,8 +574,10 @@ public: void RestorePreviousObjective(void); void SetIdle(void); #ifdef _MSC_VER +#if _MSC_VER >= 1920 && _MSC_VER < 1929 __declspec(noinline) // workaround for a compiler bug, hooray MS :P #endif +#endif void SetObjective(eObjective, void*); void SetObjective(eObjective); void SetObjective(eObjective, int16, int16); diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp index f1c753ec..8bd6791c 100644 --- a/src/peds/PedAI.cpp +++ b/src/peds/PedAI.cpp @@ -3531,23 +3531,17 @@ CPed::SetEnterCar_AllClear(CVehicle *car, uint32 doorNode, uint32 doorFlag) m_vecOffsetSeek = doorOpenPos - GetPosition(); m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 600; if (car->IsBoat()) { -#ifdef VC_PED_PORTS - // VC checks for handling flag, but we can't do that - if(car->GetModelIndex() == MI_SPEEDER) - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_CAR_SIT, 100.0f); - else - m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f); - - PedSetInCarCB(nil, this); - bVehExitWillBeInstant = true; -#else - #ifndef FIX_BUGS m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_STD_BOAT_DRIVE, 100.0f); #else m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, car->GetDriverAnim(), 100.0f); #endif + // Otherwise boat enter key sometimes processed multiple times, so you enter/exit instantly +#if defined VC_PED_PORTS || defined FIX_BUGS + PedSetInCarCB(nil, this); + bVehExitWillBeInstant = true; +#else m_pVehicleAnim->SetFinishCallback(PedSetInCarCB, this); #endif if (IsPlayer()) @@ -5194,8 +5188,10 @@ CPed::SeekBoatPosition(void) enterOffset = boatModel->GetFrontSeatPosn(); enterOffset.x = 0.0f; CMatrix boatMat(m_carInObjective->GetMatrix()); + CVector boatEnterPos = Multiply3x3(boatMat, enterOffset); + boatEnterPos += m_carInObjective->GetPosition(); SetMoveState(PEDMOVE_WALK); - m_vecSeekPos = boatMat * enterOffset; + m_vecSeekPos = boatEnterPos; if (Seek()) { // We arrived to the boat m_vehDoor = 0; diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp index 46ac369c..03d5c755 100644 --- a/src/peds/PedFight.cpp +++ b/src/peds/PedFight.cpp @@ -311,15 +311,28 @@ CPed::SetAttack(CEntity *victim) m_pLookTarget->RegisterReference((CEntity **) &m_pLookTarget); m_pSeekTarget->RegisterReference((CEntity **) &m_pSeekTarget); } + if (m_pLookTarget) { SetAimFlag(m_pLookTarget); +#ifdef FREE_CAM + } else if (this != FindPlayerPed() || !((CPlayerPed*)this)->m_bFreeAimActive) { +#else } else { +#endif SetAimFlag(m_fRotationCur); if (FindPlayerPed() == this && TheCamera.Cams[0].Using3rdPersonMouseCam()) ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); } } +#ifdef FIX_BUGS + // fix aiming for flamethrower while using PC controls + else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER && TheCamera.Cams[0].Using3rdPersonMouseCam() && this == FindPlayerPed()) + { + SetAimFlag(m_fRotationCur); + ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); + } +#endif if (m_nPedState == PED_ATTACK) { bIsAttacking = true; return; @@ -729,6 +742,15 @@ CPed::Attack(void) weaponAnimAssoc->flags &= ~ASSOC_RUNNING; SetPointGunAt(m_pPointGunAt); #endif +#ifdef FREE_CAM + } else if (IsPlayer() && ((CPlayerPed*)this)->m_bFreeAimActive && GetWeapon()->m_eWeaponState != WEAPONSTATE_RELOADING) { + float limitedCam = CGeneral::LimitRadianAngle(-TheCamera.Orientation); + SetLookFlag(limitedCam, true); + SetAimFlag(limitedCam); + SetLookTimer(INT32_MAX); + SetPointGunAt(nil); + ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); +#endif } else { ClearAimFlag(); diff --git a/src/peds/PedIK.h b/src/peds/PedIK.h index 9077fbea..1543fa34 100644 --- a/src/peds/PedIK.h +++ b/src/peds/PedIK.h @@ -29,7 +29,7 @@ class CPedIK { public: enum { - GUN_POINTED_SUCCESSFULLY = 1, // set but unused + GUN_POINTED_SUCCESSFULLY = 1, LOOKAROUND_HEAD_ONLY = 2, AIMS_WITH_ARM = 4, }; diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index 6d6fc714..ef877965 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -20,6 +20,10 @@ #define PAD_MOVE_TO_GAME_WORLD_MOVE 60.0f +#ifdef VC_PED_PORTS +bool CPlayerPed::bDontAllowWeaponChange; +#endif + const uint32 CPlayerPed::nSaveStructSize = #ifdef COMPATIBLE_SAVES 1520; @@ -503,6 +507,10 @@ CPlayerPed::DoWeaponSmoothSpray(void) { if (m_nPedState == PED_ATTACK && !m_pPointGunAt) { eWeaponType weapon = GetWeapon()->m_eWeaponType; +#ifdef FREE_CAM + if(CCamera::bFreeCam && TheCamera.Cams[0].Using3rdPersonMouseCam() && (weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI)) + return false; +#endif if (weapon == WEAPONTYPE_FLAMETHROWER || weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI || weapon == WEAPONTYPE_SHOTGUN || weapon == WEAPONTYPE_AK47 || weapon == WEAPONTYPE_M16 || weapon == WEAPONTYPE_HELICANNON) return true; @@ -599,7 +607,11 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed) if (CDarkel::FrenzyOnGoing()) goto switchDetectDone; +#ifdef VC_PED_PORTS + if (padUsed->CycleWeaponRightJustDown() && !m_pPointGunAt && !bDontAllowWeaponChange) { +#else if (padUsed->CycleWeaponRightJustDown() && !m_pPointGunAt) { +#endif if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON_RUNABOUT @@ -615,7 +627,11 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed) } m_nSelectedWepSlot = WEAPONTYPE_UNARMED; } +#ifdef VC_PED_PORTS + } else if (padUsed->CycleWeaponLeftJustDown() && !m_pPointGunAt && !bDontAllowWeaponChange) { +#else } else if (padUsed->CycleWeaponLeftJustDown() && !m_pPointGunAt) { +#endif if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_ROCKETLAUNCHER) { @@ -853,7 +869,11 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft) // nextTarget = nil; // duplicate float lastCloseness = -10000.0f; // CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused +#ifdef VC_PED_PORTS + CVector distVec = previousTarget->GetPosition() - TheCamera.GetPosition(); +#else CVector distVec = previousTarget->GetPosition() - GetPosition(); +#endif float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y); for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) { @@ -878,6 +898,9 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft) return false; SetWeaponLockOnTarget(nextTarget); +#ifdef VC_PED_PORTS + bDontAllowWeaponChange = true; +#endif SetPointGunAt(nextTarget); return true; } @@ -923,6 +946,9 @@ CPlayerPed::FindWeaponLockOnTarget(void) return false; SetWeaponLockOnTarget(nextTarget); +#ifdef VC_PED_PORTS + bDontAllowWeaponChange = true; +#endif SetPointGunAt(nextTarget); return true; } @@ -1056,7 +1082,9 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed) #ifdef FREE_CAM static int8 changedHeadingRate = 0; + static int8 pointedGun = 0; if (changedHeadingRate == 2) changedHeadingRate = 1; + if (pointedGun == 2) pointedGun = 1; // Rotate player/arm when shooting. We don't have auto-rotation anymore if (CCamera::m_bUseMouse3rdPerson && CCamera::bFreeCam && @@ -1067,22 +1095,28 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed) if ((padUsed->GetTarget() && weaponInfo->IsFlagSet(WEAPONFLAG_CANAIM_WITHARM)) || padUsed->GetWeapon()) { float limitedCam = CGeneral::LimitRadianAngle(-TheCamera.Orientation); + m_cachedCamSource = TheCamera.Cams[TheCamera.ActiveCam].Source; + m_cachedCamFront = TheCamera.Cams[TheCamera.ActiveCam].Front; + m_cachedCamUp = TheCamera.Cams[TheCamera.ActiveCam].Up; + // On this one we can rotate arm. if (weaponInfo->IsFlagSet(WEAPONFLAG_CANAIM_WITHARM)) { - if (!padUsed->GetWeapon()) { // making this State != ATTACK still stops it after attack. Re-start it immediately! - SetPointGunAt(nil); - bIsPointingGunAt = false; // to not stop after attack - } - + pointedGun = 2; + m_bFreeAimActive = true; SetLookFlag(limitedCam, true); SetAimFlag(limitedCam); #ifdef VC_PED_PORTS SetLookTimer(INT32_MAX); // removing this makes head move for real, but I experinced some bugs. #endif + ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); + if (m_nPedState != PED_ATTACK && m_nPedState != PED_AIM_GUN) { + // This is a seperate ped state just for pointing gun. Used for target button + SetPointGunAt(nil); + } } else { m_fRotationDest = limitedCam; changedHeadingRate = 2; - m_headingRate = 50.0f; + m_headingRate = 12.5f; // Anim. fix for shotgun, ak47 and m16 (we must finish rot. it quickly) if (weaponInfo->IsFlagSet(WEAPONFLAG_CANAIM) && padUsed->WeaponJustDown()) { @@ -1098,14 +1132,27 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed) m_fRotationCur += (limitedRotDest - m_fRotationCur) / 2; } } - } else if (weaponInfo->IsFlagSet(WEAPONFLAG_CANAIM_WITHARM) && m_nPedState != PED_ATTACK) - ClearPointGunAt(); + } } } if (changedHeadingRate == 1) { changedHeadingRate = 0; RestoreHeadingRate(); } + if (pointedGun == 1) { + if (m_nPedState == PED_ATTACK) { + if (!padUsed->GetWeapon() && (m_pedIK.m_flags & CPedIK::GUN_POINTED_SUCCESSFULLY) == 0) { + float limitedCam = CGeneral::LimitRadianAngle(-TheCamera.Orientation); + + SetAimFlag(limitedCam); + ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); + m_bFreeAimActive = true; + } + } else { + pointedGun = 0; + ClearPointGunAt(); + } + } #endif if (padUsed->GetTarget() && m_nSelectedWepSlot == m_currentWeapon && m_nMoveState != PEDMOVE_SPRINT) { @@ -1183,6 +1230,13 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed) padMoveInGameUnit = CVector2D(leftRight, upDown).Magnitude() / PAD_MOVE_TO_GAME_WORLD_MOVE; } +#ifdef FREE_CAM + if(CCamera::bFreeCam && TheCamera.Cams[0].Using3rdPersonMouseCam() && doSmoothSpray) { + padMoveInGameUnit = 0.0f; + smoothSprayWithoutMove = false; + } +#endif + if (padMoveInGameUnit > 0.0f || smoothSprayWithoutMove) { float padHeading = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown); float neededTurn = CGeneral::LimitRadianAngle(padHeading - camOrientation); @@ -1479,6 +1533,13 @@ CPlayerPed::ProcessControl(void) m_bSpeedTimerFlag = false; } +#ifdef VC_PED_PORTS + if (bDontAllowWeaponChange && FindPlayerPed() == this) { + if (!CPad::GetPad(0)->GetTarget()) + bDontAllowWeaponChange = false; + } +#endif + #ifdef PED_SKIN if (!bIsVisible && IsClumpSkinned(GetClump())) UpdateRpHAnim(); diff --git a/src/peds/PlayerPed.h b/src/peds/PlayerPed.h index e8173c8c..2e9f7989 100644 --- a/src/peds/PlayerPed.h +++ b/src/peds/PlayerPed.h @@ -34,6 +34,15 @@ public: CPed *m_pPedAtSafePos[6]; float m_fWalkAngle; float m_fFPSMoveHeading; +#ifdef FREE_CAM + bool m_bFreeAimActive; + CVector m_cachedCamSource; + CVector m_cachedCamFront; + CVector m_cachedCamUp; +#endif +#ifdef VC_PED_PORTS + static bool bDontAllowWeaponChange; +#endif CPlayerPed(); ~CPlayerPed(); diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index 1d2a5798..5c80702f 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -999,7 +999,7 @@ bool CPopulation::TestRoomForDummyObject(CObject *obj) { int16 collidingObjs; - CWorld::FindObjectsKindaColliding(obj->m_objectMatrix.GetPosition(), CModelInfo::GetModelInfo(obj->GetModelIndex())->GetColModel()->boundingSphere.radius, + CWorld::FindObjectsKindaColliding(obj->m_objectMatrix.GetPosition(), CModelInfo::GetColModel(obj->GetModelIndex())->boundingSphere.radius, false, &collidingObjs, 2, nil, false, true, true, false, false); return collidingObjs == 0; @@ -1126,13 +1126,16 @@ CPopulation::ManagePopulation(void) bool pedIsFarAway = false; if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist || (!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist) +#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE || (PedCreationDistMultiplier() * (MIN_CREATION_DIST + CREATION_RANGE) * OFFSCREEN_CREATION_MULT < dist && !ped->GetIsOnScreen() && TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER && TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER_RUNABOUT && !TheCamera.Cams[TheCamera.ActiveCam].LookingLeft && !TheCamera.Cams[TheCamera.ActiveCam].LookingRight - && !TheCamera.Cams[TheCamera.ActiveCam].LookingBehind)) + && !TheCamera.Cams[TheCamera.ActiveCam].LookingBehind) +#endif + ) pedIsFarAway = true; if (!pedIsFarAway) |