1
0
Fork 0
mirror of https://github.com/halpz/re3.git synced 2024-12-26 18:15:27 +00:00

Merge pull request #181 from Nick007J/master

fixes
This commit is contained in:
aap 2019-08-03 20:46:35 +02:00 committed by GitHub
commit 3b9b0646b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View file

@ -3239,9 +3239,7 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command)
{ {
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
float angle = pPed->bInVehicle ? float angle = pPed->bInVehicle ? pPed->m_pMyVehicle->GetForward().Heading() : pPed->GetForward().Heading();
Atan2(-pPed->m_pMyVehicle->GetForward().x, pPed->m_pMyVehicle->GetForward().y) :
Atan2(-pPed->GetForward().x, pPed->GetForward().y);
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle)); *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
StoreParameters(&m_nIp, 1); StoreParameters(&m_nIp, 1);
return 0; return 0;
@ -3263,9 +3261,7 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command)
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
assert(pPed); assert(pPed);
float angle = pPed->bInVehicle ? float angle = pPed->bInVehicle ? pPed->m_pMyVehicle->GetForward().Heading() : pPed->GetForward().Heading();
Atan2(-pPed->m_pMyVehicle->GetForward().x, pPed->m_pMyVehicle->GetForward().y) :
Atan2(-pPed->GetForward().x, pPed->GetForward().y);
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle)); *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
StoreParameters(&m_nIp, 1); StoreParameters(&m_nIp, 1);
return 0; return 0;
@ -3288,7 +3284,7 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command)
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle); assert(pVehicle);
float angle = Atan2(-pVehicle->GetForward().x, pVehicle->GetForward().y); float angle = pVehicle->GetForward().Heading();
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle)); *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
StoreParameters(&m_nIp, 1); StoreParameters(&m_nIp, 1);
return 0; return 0;
@ -3306,7 +3302,7 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command)
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]); CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
assert(pObject); assert(pObject);
float angle = Atan2(-pObject->GetForward().x, pObject->GetForward().y); float angle = pObject->GetForward().Heading();
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle)); *(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
StoreParameters(&m_nIp, 1); StoreParameters(&m_nIp, 1);
return 0; return 0;

View file

@ -144,7 +144,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
if(veh && veh->IsTrain()){ if(veh && veh->IsTrain()){
if(((CTrain*)veh)->m_nDoorState != TRAIN_DOOR_OPEN) if(((CTrain*)veh)->m_nDoorState != TRAIN_DOOR_OPEN)
return; return;
}else if(playerCoors.z < 4.0f && !CCullZones::DoINeedToLoadCollision()) }else if(playerCoors.z < -4.0f && !CCullZones::DoINeedToLoadCollision())
return; return;
// Figure out whose level's collisions we're most likely to be interested in // Figure out whose level's collisions we're most likely to be interested in