summaryrefslogtreecommitdiffstats
path: root/src/peds/PedAttactor.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-16 00:49:30 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-16 00:49:30 +0200
commit08b2138c7e59ce3350d333832ceca5c24799a34c (patch)
treee1630132472fc19fa20805e5bb65394a03a49ea5 /src/peds/PedAttactor.cpp
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
downloadre3-08b2138c7e59ce3350d333832ceca5c24799a34c.tar
re3-08b2138c7e59ce3350d333832ceca5c24799a34c.tar.gz
re3-08b2138c7e59ce3350d333832ceca5c24799a34c.tar.bz2
re3-08b2138c7e59ce3350d333832ceca5c24799a34c.tar.lz
re3-08b2138c7e59ce3350d333832ceca5c24799a34c.tar.xz
re3-08b2138c7e59ce3350d333832ceca5c24799a34c.tar.zst
re3-08b2138c7e59ce3350d333832ceca5c24799a34c.zip
Diffstat (limited to '')
-rw-r--r--src/peds/PedAttactor.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/peds/PedAttactor.cpp b/src/peds/PedAttactor.cpp
index bef14308..a3b93067 100644
--- a/src/peds/PedAttactor.cpp
+++ b/src/peds/PedAttactor.cpp
@@ -485,7 +485,7 @@ bool CPedAttractorManager::BroadcastArrival(CPed* pPed, CPedAttractor* pAttracto
return false;
if (pAttractor->GetEffect()->type != EFFECT_PED_ATTRACTOR)
return nil;
- if (IsPedRegisteredWithEffect(pPed))
+ if (!IsPedRegisteredWithEffect(pPed))
return nil;
switch (pAttractor->GetEffect()->pedattr.type) {
case ATTRACTOR_ATM: return BroadcastArrival(pPed, pAttractor, vAtmAttractors);
@@ -504,7 +504,7 @@ bool CPedAttractorManager::BroadcastDeparture(CPed* pPed, CPedAttractor* pAttrac
return false;
if (pAttractor->GetEffect()->type != EFFECT_PED_ATTRACTOR)
return nil;
- if (IsPedRegisteredWithEffect(pPed))
+ if (!IsPedRegisteredWithEffect(pPed))
return nil;
switch (pAttractor->GetEffect()->pedattr.type) {
case ATTRACTOR_ATM: return BroadcastDeparture(pPed, pAttractor, vAtmAttractors);
@@ -523,7 +523,7 @@ bool CPedAttractorManager::IsAtHeadOfQueue(CPed* pPed, CPedAttractor* pAttractor
return false;
if (pAttractor->GetEffect()->type != EFFECT_PED_ATTRACTOR)
return nil;
- if (IsPedRegisteredWithEffect(pPed))
+ if (!IsPedRegisteredWithEffect(pPed))
return nil;
switch (pAttractor->GetEffect()->pedattr.type) {
case ATTRACTOR_ATM: return IsAtHeadOfQueue(pPed, pAttractor, vAtmAttractors);
@@ -542,7 +542,7 @@ bool CPedAttractorManager::IsInQueue(CPed* pPed, CPedAttractor* pAttractor)
return false;
if (pAttractor->GetEffect()->type != EFFECT_PED_ATTRACTOR)
return nil;
- if (IsPedRegisteredWithEffect(pPed))
+ if (!IsPedRegisteredWithEffect(pPed))
return nil;
switch (pAttractor->GetEffect()->pedattr.type) {
case ATTRACTOR_ATM: return IsInQueue(pPed, pAttractor, vAtmAttractors);
@@ -747,13 +747,13 @@ bool CPedAttractorManager::IsApproachable(C2dEffect* pEffect, const CMatrix& mat
ComputeEffectPos(pEffect, matrix, vecEffectPos);
float dp = -DotProduct(vecUseDir, vecEffectPos);
if (pEffect->pedattr.type == ATTRACTOR_ATM || pEffect->pedattr.type == ATTRACTOR_PIZZA || pEffect->pedattr.type == ATTRACTOR_ICECREAM) {
- vecUseDir = vecUseDir;
+ vecUseDir = -vecUseDir;
dp = -dp;
}
if (dp + DotProduct(vecEffectPos, pPed->GetPosition()) > 0.0f) {
CVector vecPedToAttractor = pPed->GetPosition() - vecEffectPos;
vecPedToAttractor.Normalise();
- if (DotProduct(vecPedToAttractor, vecUseDir) > 0.25f /* && CWorld::IsWanderPathClear(pPed, vecEffectPos, 2.0f, 0) */)
+ if (DotProduct(vecPedToAttractor, vecUseDir) > 0.25f && CWorld::IsWanderPathClear(pPed->GetPosition(), vecEffectPos, 2.0f, 0))
return true;
}
return false;