summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-17 20:48:12 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-17 20:48:12 +0200
commit3cc20d7962c317aeb1e1e36e77ec270298b51cdb (patch)
treec6fcaef6b3271d8407530c826b92367a4e81ff17 /src/control/Script.cpp
parentfull script basic support (diff)
parentMerge pull request #555 from erorcun/miami (diff)
downloadre3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar
re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.gz
re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.bz2
re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.lz
re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.xz
re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.zst
re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.zip
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r--src/control/Script.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index cfa5be46..6a6c5160 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -2909,13 +2909,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
pVehicle->bEngineOn = true;
pPed->bUsesCollision = false;
-#ifdef FIX_BUGS
- AnimationId anim = pVehicle->GetDriverAnim();
-#else
- AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
-#endif
- pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
- pPed->StopNonPartialAnims();
+ pPed->AddInCarAnims(pVehicle, true);
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
CWorld::Add(pPed);
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
@@ -4088,13 +4082,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
pPed->SetPedState(PED_DRIVING);
pVehicle->SetStatus(STATUS_PHYSICS);
pPed->bUsesCollision = false;
-#ifdef FIX_BUGS
- AnimationId anim = pVehicle->GetDriverAnim();
-#else
- AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
-#endif
- pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
- pPed->StopNonPartialAnims();
+ pPed->AddInCarAnims(pVehicle, false);
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
CWorld::Add(pPed);
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
@@ -9831,16 +9819,11 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
{
CollectParameters(&m_nIp, 3);
CVector pos = *(CVector*)&ScriptParams[0];
- bool bFound = false;
- for (int i = 0; i < NUMPICKUPS; i++) {
- if ((CPickups::aPickUps[i].m_vecPos - pos).Magnitude() < 0.5f)
- bFound = true;
- }
- UpdateCompareFlag(bFound);
+ CRunningScript::UpdateCompareFlag(CPickups::TestForPickupsInBubble(pos, 0.5f));
return 0;
}
- //case COMMAND_GET_FIRST_PICKUP_COORDS:
- //case COMMAND_GET_NEXT_PICKUP_COORDS:
+ case COMMAND_GET_FIRST_PICKUP_COORDS:
+ case COMMAND_GET_NEXT_PICKUP_COORDS:
case COMMAND_REMOVE_ALL_CHAR_WEAPONS:
{
CollectParameters(&m_nIp, 1);
@@ -9984,8 +9967,10 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
case COMMAND_GET_DEAD_CHAR_PICKUP_COORDS:
{
CollectParameters(&m_nIp, 1);
- CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
- pPed->CreateDeadPedPickupCoors((float*)&ScriptParams[0], (float*)&ScriptParams[1], (float*)&ScriptParams[2]);
+ CPed *pTarget = CPools::GetPedPool()->GetAt(ScriptParams[0]);
+ CVector pos;
+ pTarget->CreateDeadPedPickupCoors(&pos.x, &pos.y, &pos.z);
+ *(CVector*)&ScriptParams[0] = pos;
StoreParameters(&m_nIp, 3);
return 0;
}