Merge pull request #323 from erorcun/erorcun

few little things
This commit is contained in:
erorcun 2020-02-04 00:31:26 +03:00 committed by GitHub
commit 9cb5c50012
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2120,18 +2120,16 @@ CPed::SortPeds(CPed **list, int min, int max)
int left = max; int left = max;
int right; int right;
for(right = min; right <= left; ){ for(right = min; right <= left; ){
// Those 1.0s are my addition to make sure loop always run for first time. float rightDist, leftDist;
for (float rightDist = middleDist-1.0f; middleDist > rightDist; right++) { do {
rightDiff = GetPosition() - list[right]->GetPosition(); rightDiff = GetPosition() - list[right]->GetPosition();
rightDist = rightDiff.Magnitude(); rightDist = rightDiff.Magnitude();
} } while (middleDist > rightDist && ++right);
right--;
for (float leftDist = middleDist+1.0f; middleDist < leftDist; left--) { do {
leftDiff = GetPosition() - list[left]->GetPosition(); leftDiff = GetPosition() - list[left]->GetPosition();
leftDist = leftDiff.Magnitude(); leftDist = leftDiff.Magnitude();
} } while (middleDist < leftDist && left--);
left++;
if (right <= left) { if (right <= left) {
CPed *ped = list[right]; CPed *ped = list[right];
@ -13136,10 +13134,9 @@ CPed::ProcessObjective(void)
{ {
if (!m_carInObjective || bInVehicle) { if (!m_carInObjective || bInVehicle) {
#ifdef VC_PED_PORTS #ifdef VC_PED_PORTS
if (bInVehicle && m_pMyVehicle != m_carInObjective) if (bInVehicle && m_pMyVehicle != m_carInObjective) {
{
SetExitCar(m_pMyVehicle, 0); SetExitCar(m_pMyVehicle, 0);
} } else
#endif #endif
{ {
bObjectiveCompleted = true; bObjectiveCompleted = true;