mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-27 09:25:40 +00:00
more attractor fixes
This commit is contained in:
parent
cf5db73117
commit
9067469f7c
3 changed files with 36 additions and 23 deletions
|
@ -12,6 +12,8 @@ const int gcMaxSizeOfPizzaQueue = 5;
|
|||
const int gcMaxSizeOfShelterQueue = 5;
|
||||
const int gcMaxSizeOfIceCreamQueue = 1;
|
||||
|
||||
//--MIAMI: file done, except TODO(MIAMI)
|
||||
|
||||
std::vector<CVector> CPedShelterAttractor::ms_displacements;
|
||||
|
||||
CPedAttractorManager* GetPedAttractorManager()
|
||||
|
@ -163,6 +165,23 @@ CPedAttractor::CPedAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 ma
|
|||
CPedAttractorManager::ComputeEffectUseDir(pEffect, matrix, vecUseDir);
|
||||
}
|
||||
|
||||
void CPedPizzaAttractor::UpdatePedStateOnDeparture(CPed* pPed) const
|
||||
{
|
||||
/* TODO(MIAMI): uncomment
|
||||
if (pPed->m_nPedMoney > 10)
|
||||
pPed->m_nPedMoney -= 10;
|
||||
else
|
||||
pPed->m_nPedMoney = 0;
|
||||
*/
|
||||
}
|
||||
|
||||
void CPedAtmAttractor::UpdatePedStateOnDeparture(CPed* pPed) const
|
||||
{
|
||||
/* TODO(MIAMI): uncomment
|
||||
pPed->m_nPedMoney += 20 * CGeneral::GetRandomNumberInRange(1, 51);
|
||||
*/
|
||||
};
|
||||
|
||||
float CPedAttractor::ComputeDeltaHeading() const
|
||||
{
|
||||
return CGeneral::GetRandomNumberInRange(-m_fMaxHeadingDisplacement, m_fMaxHeadingDisplacement);
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
bool RegisterPed(CPed*);
|
||||
bool BroadcastArrival(CPed*);
|
||||
|
||||
CPedAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float unk8, float unk9, float posdisp, float headdisp);
|
||||
CPedAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp);
|
||||
|
||||
C2dEffect* GetEffect() const { return p2dEffect; }
|
||||
const CVector& GetEffectPos() const { return vecEffectPos; }
|
||||
|
@ -127,9 +127,9 @@ class CPedAtmAttractor : public CPedAttractor
|
|||
{
|
||||
public:
|
||||
virtual ePedAttractorType GetType() const override { return ATTRACTOR_ATM; };
|
||||
virtual void UpdatePedStateOnDeparture(CPed* pPed) const override { /* pPed->m_money += 20 * CGeneral::GetRandomNumberInRange(1, 51); */ };
|
||||
CPedAtmAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float unk8, float unk9, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, unk8, unk9, posdisp, headdisp)
|
||||
virtual void UpdatePedStateOnDeparture(CPed* pPed) const override;
|
||||
CPedAtmAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp)
|
||||
{};
|
||||
};
|
||||
|
||||
|
@ -139,8 +139,8 @@ public:
|
|||
virtual ~CPedIceCreamAttractor() override { GetPedAttractorManager()->RemoveIceCreamVanEffects(p2dEffect); }
|
||||
virtual ePedAttractorType GetType() const override { return ATTRACTOR_ICECREAM; }
|
||||
virtual void UpdatePedStateOnDeparture(CPed* pPed) const override {};
|
||||
CPedIceCreamAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float unk8, float unk9, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, unk8, unk9, posdisp, headdisp)
|
||||
CPedIceCreamAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp)
|
||||
{};
|
||||
};
|
||||
|
||||
|
@ -149,16 +149,9 @@ class CPedPizzaAttractor : public CPedAttractor
|
|||
public:
|
||||
virtual float GetHeadOfQueueWaitTime() override { return 2000.0f; }
|
||||
virtual ePedAttractorType GetType() const override { return ATTRACTOR_PIZZA; }
|
||||
virtual void UpdatePedStateOnDeparture(CPed* pPed) const override
|
||||
{ /*
|
||||
if (pPed->m_money > 10)
|
||||
pPed->m_money -= 10;
|
||||
else
|
||||
pPed->m_money = 0;
|
||||
*/
|
||||
}
|
||||
CPedPizzaAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float unk8, float unk9, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, unk8, unk9, posdisp, headdisp)
|
||||
virtual void UpdatePedStateOnDeparture(CPed* pPed) const override;
|
||||
CPedPizzaAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp)
|
||||
{};
|
||||
};
|
||||
|
||||
|
@ -167,8 +160,8 @@ class CPedSeatAttractor : public CPedAttractor
|
|||
public:
|
||||
virtual ePedAttractorType GetType() const override { return ATTRACTOR_SEAT; }
|
||||
virtual void UpdatePedStateOnDeparture(CPed* pPed) const override {};
|
||||
CPedSeatAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float unk8, float unk9, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, unk8, unk9, posdisp, headdisp)
|
||||
CPedSeatAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp)
|
||||
{};
|
||||
};
|
||||
|
||||
|
@ -183,8 +176,8 @@ public:
|
|||
virtual void ComputeAttractPos(int qid, CVector& pos) const override;
|
||||
virtual void ComputeAttractHeading(int qid, float& heading) const override;
|
||||
|
||||
CPedShelterAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float unk8, float unk9, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, unk8, unk9, posdisp, headdisp)
|
||||
CPedShelterAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp)
|
||||
{};
|
||||
|
||||
|
||||
|
@ -197,7 +190,7 @@ public:
|
|||
virtual ePedAttractorType GetType() const override { return ATTRACTOR_STOP; }
|
||||
virtual void UpdatePedStateOnDeparture(CPed* pPed) const override {};
|
||||
|
||||
CPedStopAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float unk8, float unk9, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, unk8, unk9, posdisp, headdisp)
|
||||
CPedStopAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) :
|
||||
CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp)
|
||||
{};
|
||||
};
|
|
@ -1123,7 +1123,8 @@ CPopulation::AddDeadPedInFrontOfCar(const CVector& pos, CVehicle* pCulprit)
|
|||
return nil;
|
||||
CPed* pPed = CPopulation::AddPed(PEDTYPE_CIVMALE, MI_MALE01, pos); // TODO(MIAMI): 4th parameter
|
||||
pPed->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
||||
//TODO(MIAMI): set money == 0
|
||||
//TODO(MIAMI): uncomment
|
||||
//pPed->m_nPedMoney = 0;
|
||||
pPed->bDeadPedInFrontOfCar = true;
|
||||
pPed->m_vehicleInAccident = pCulprit;
|
||||
pCulprit->RegisterReference((CEntity**)&pPed->m_vehicleInAccident);
|
||||
|
|
Loading…
Reference in a new issue