sync with upstream

This commit is contained in:
Nikolay Korolev 2020-05-17 21:48:12 +03:00
commit 3cc20d7962
42 changed files with 7909 additions and 10148 deletions

View file

@ -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;
}