summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-07-04 21:24:23 +0200
committerGitHub <noreply@github.com>2020-07-04 21:24:23 +0200
commit2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66 (patch)
tree80309bd9483c238a85d37b3a90c1ab3b54b4bc28 /src/peds
parentMerge pull request #647 from Fire-Head/miami (diff)
parentice cream attractor + bike respray (diff)
downloadre3-2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66.tar
re3-2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66.tar.gz
re3-2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66.tar.bz2
re3-2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66.tar.lz
re3-2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66.tar.xz
re3-2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66.tar.zst
re3-2c50cf8ac6a24129d63bd8ed5c42c2df14d51d66.zip
Diffstat (limited to '')
-rw-r--r--src/peds/Ped.cpp49
-rw-r--r--src/peds/PedAttractor.cpp8
2 files changed, 47 insertions, 10 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 807fd53e..a3672186 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -403,6 +403,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
bReachedAttractorHeadingTarget = false;
bTurnedAroundOnAttractor = false;
+ bHasAlreadyUsedAttractor = false;
bCarPassenger = false;
bMiamiViceCop = false;
bMoneyHasBeenGivenByScript = false;
@@ -8209,6 +8210,10 @@ CPed::Wait(void)
animAssoc->blendDelta = -4.0f;
animAssoc->flags |= ASSOC_DELETEFADEDOUT;
}
+ if (m_attractor && m_objective == OBJECTIVE_WAIT_ON_FOOT_AT_ICE_CREAM_VAN) {
+ GetPedAttractorManager()->BroadcastDeparture(this, m_attractor);
+ bBoughtIceCream = true;
+ }
ClearWaitState();
}
#ifdef VC_PED_PORTS
@@ -15064,6 +15069,38 @@ CPed::ProcessObjective(void)
}
}
break;
+ case OBJECTIVE_WAIT_ON_FOOT_AT_ICE_CREAM_VAN:
+ {
+ SetIdle();
+ CVehicle* pIceCreamVan = GetPedAttractorManager()->GetIceCreamVanForEffect(m_attractor->GetEffect());
+ if (m_attractor && m_nWaitState != WAITSTATE_PLAYANIM_CHAT && pIceCreamVan && pIceCreamVan->pDriver && pIceCreamVan->pDriver->IsPlayer()) {
+ int time = 5000;
+ SetWaitState(WAITSTATE_PLAYANIM_CHAT, &time);
+ break;
+ }
+ if (!m_attractor)
+ break;
+ CVehicle* pVan = GetPedAttractorManager()->GetIceCreamVanForEffect(m_attractor->GetEffect());
+ if (!pVan)
+ break;
+ if (0.01f * CTimer::GetTimeStep() * 5.0f < pVan->m_fDistanceTravelled) {
+ GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
+ break;
+ }
+ if (!pVan->pDriver || !pVan->pDriver->IsPlayer() || pVan->pDriver->GetPedState() == PED_ARRESTED || pVan->pDriver->GetPedState() == PED_DEAD) {
+ GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
+ break;
+ }
+ if (!pVan->m_bSirenOrAlarm) {
+ GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
+ return; // ???
+ }
+ if (pVan->GetStatus() == STATUS_WRECKED) {
+ GetPedAttractorManager()->DeRegisterPed(this, m_attractor);
+ return; // ???
+ }
+ break;
+ }
#endif
}
if (bObjectiveCompleted
@@ -18714,28 +18751,28 @@ CPed::SetObjective(eObjective newObj, CVector dest)
m_nextRoutePointPos = dest;
m_vecSeekPos = m_nextRoutePointPos;
m_distanceToCountSeekDone = 0.5f;
- if (m_objective == OBJECTIVE_GOTO_ATM_ON_FOOT) {
+ if (newObj == OBJECTIVE_GOTO_ATM_ON_FOOT) {
m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone();
m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading();
}
- if (m_objective == OBJECTIVE_GOTO_SEAT_ON_FOOT) {
+ if (newObj == OBJECTIVE_GOTO_SEAT_ON_FOOT) {
m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone();
m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading();
}
- if (m_objective == OBJECTIVE_GOTO_BUS_STOP_ON_FOOT) {
+ if (newObj == OBJECTIVE_GOTO_BUS_STOP_ON_FOOT) {
m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone();
m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading();
}
- if (m_objective == OBJECTIVE_GOTO_PIZZA_ON_FOOT) {
+ if (newObj == OBJECTIVE_GOTO_PIZZA_ON_FOOT) {
m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone();
m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading();
}
- if (m_objective == OBJECTIVE_GOTO_SHELTER_ON_FOOT) {
+ if (newObj == OBJECTIVE_GOTO_SHELTER_ON_FOOT) {
bIsRunning = true;
m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone();
m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading();
}
- if (m_objective == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT) {
+ if (newObj == OBJECTIVE_GOTO_ICE_CREAM_VAN_ON_FOOT) {
bIsRunning = true;
m_distanceToCountSeekDone = m_attractor->GetDistanceToCountSeekDone();
m_acceptableHeadingOffset = m_attractor->GetAcceptableHeading();
diff --git a/src/peds/PedAttractor.cpp b/src/peds/PedAttractor.cpp
index 659a522b..db5f9e52 100644
--- a/src/peds/PedAttractor.cpp
+++ b/src/peds/PedAttractor.cpp
@@ -71,15 +71,15 @@ const C2dEffect* CVehicleToEffect::ChooseEffect(const CVector& pos) const
return nil;
if (DotProduct(pos - m_pVehicle->GetPosition(), m_pVehicle->GetRight()) > 0.0f) {
if (DotProduct(pos - m_pVehicle->GetPosition(), m_pVehicle->GetForward()) > 0.0f)
- return &m_effects[0];
+ return &m_effects[1];
else
- return &m_effects[2];
+ return &m_effects[3];
}
else {
if (DotProduct(pos - m_pVehicle->GetPosition(), m_pVehicle->GetForward()) > 0.0f)
- return &m_effects[1];
+ return &m_effects[0];
else
- return &m_effects[3];
+ return &m_effects[2];
}
}