diff options
author | aap <aap@papnet.eu> | 2020-05-05 18:06:38 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-05 18:06:38 +0200 |
commit | e81652c2fc2787fc8aab3937be62127e7a3354ee (patch) | |
tree | c36897c90f4f37796ec955c49e70e99944de7dda /src/control/CarCtrl.cpp | |
parent | Merge pull request #514 from Nick007J/miami (diff) | |
download | re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.gz re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.bz2 re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.lz re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.xz re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.tar.zst re3-e81652c2fc2787fc8aab3937be62127e7a3354ee.zip |
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r-- | src/control/CarCtrl.cpp | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index f0f95941..6a5d37f3 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -696,7 +696,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle) if (pVehicle->bExtendedRange) threshold *= 1.5f; if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){ - if (pVehicle->GetIsOnScreenAndNotCulled()){ + if (pVehicle->GetIsOnScreen()){ pVehicle->bFadeOut = true; }else{ CWorld::Remove(pVehicle); @@ -722,7 +722,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle) if (pVehicle->GetStatus() != STATUS_WRECKED || pVehicle->m_nTimeOfDeath == 0) return; if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 && - !pVehicle->GetIsOnScreenAndNotCulled()){ + !pVehicle->GetIsOnScreen()){ if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(7.5f)){ if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){ CWorld::Remove(pVehicle); @@ -1641,43 +1641,13 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t CPathNode* pTargetNode; int16 numNodes; float distanceToTargetNode; -#ifndef MIAMI - if (pTarget && pTarget->m_pCurGroundEntity && - pTarget->m_pCurGroundEntity->IsBuilding() && - ((CBuilding*)pTarget->m_pCurGroundEntity)->GetIsATreadable() && - ((CTreadable*)pTarget->m_pCurGroundEntity)->m_nodeIndices[0][0] >= 0){ - CTreadable* pCurrentMapObject = (CTreadable*)pTarget->m_pCurGroundEntity; - int closestNode = -1; - float minDist = 100000.0f; - for (int i = 0; i < 12; i++){ - int node = pCurrentMapObject->m_nodeIndices[0][i]; - if (node < 0) - break; - float dist = (ThePaths.m_pathNodes[node].GetPosition() - pTarget->GetPosition()).Magnitude(); - if (dist < minDist){ - minDist = dist; - closestNode = node; - } - } - ThePaths.DoPathSearch(0, pCurNode->GetPosition(), curNode, -#ifdef FIX_PATHFIND_BUG - CVector(targetX, targetY, targetZ), -#else - CVector(targetX, targetY, 0.0f), -#endif - &pTargetNode, &numNodes, 1, pVehicle, &distanceToTargetNode, 999999.9f, closestNode); - }else -#endif - { - - ThePaths.DoPathSearch(0, pCurNode->GetPosition(), curNode, + ThePaths.DoPathSearch(0, pCurNode->GetPosition(), curNode, #ifdef FIX_PATHFIND_BUG - CVector(targetX, targetY, targetZ), + CVector(targetX, targetY, targetZ), #else - CVector(targetX, targetY, 0.0f), + CVector(targetX, targetY, 0.0f), #endif - &pTargetNode, &numNodes, 1, pVehicle, &distanceToTargetNode, 999999.9f, -1); - } + &pTargetNode, &numNodes, 1, pVehicle, &distanceToTargetNode, 999999.9f, -1); int newNextNode; int nextLink; |