mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-15 14:04:08 +00:00
PlayerInfo functions reordered into original order, FindPlayer... functions moved to PlayerInfo, improved CVector <-> RwV3d conversion, small fixes
This commit is contained in:
parent
cc5af26417
commit
e9a5670348
28 changed files with 470 additions and 476 deletions
|
@ -1361,102 +1361,6 @@ CWorld::FindMissionEntitiesIntersectingCubeSectorList(CPtrList &list, const CVec
|
|||
}
|
||||
}
|
||||
|
||||
CPlayerPed *
|
||||
FindPlayerPed(void)
|
||||
{
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pPed;
|
||||
}
|
||||
|
||||
CVehicle *
|
||||
FindPlayerVehicle(void)
|
||||
{
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped && ped->InVehicle()) return ped->m_pMyVehicle;
|
||||
return nil;
|
||||
}
|
||||
|
||||
CVehicle *
|
||||
FindPlayerTrain(void)
|
||||
{
|
||||
if(FindPlayerVehicle() && FindPlayerVehicle()->IsTrain())
|
||||
return FindPlayerVehicle();
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
CEntity *
|
||||
FindPlayerEntity(void)
|
||||
{
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle;
|
||||
else
|
||||
return ped;
|
||||
}
|
||||
|
||||
CVector
|
||||
FindPlayerCoors(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (CReplay::IsPlayingBack())
|
||||
return TheCamera.GetPosition();
|
||||
#endif
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle->GetPosition();
|
||||
else
|
||||
return ped->GetPosition();
|
||||
}
|
||||
|
||||
CVector &
|
||||
FindPlayerSpeed(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
static CVector vecTmpVector(0.0f, 0.0f, 0.0f);
|
||||
if (CReplay::IsPlayingBack())
|
||||
return vecTmpVector;
|
||||
#endif
|
||||
CPlayerPed *ped = FindPlayerPed();
|
||||
if(ped->InVehicle())
|
||||
return ped->m_pMyVehicle->m_vecMoveSpeed;
|
||||
else
|
||||
return ped->m_vecMoveSpeed;
|
||||
}
|
||||
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld(int32 player)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if(CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||
#endif
|
||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||
if(CWorld::Players[player].m_pRemoteVehicle) return CWorld::Players[player].m_pRemoteVehicle->GetPosition();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
||||
return CWorld::Players[player].m_pPed->GetPosition();
|
||||
}
|
||||
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld_NoSniperShift(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
if (CReplay::IsPlayingBack()) return TheCamera.GetPosition();
|
||||
#endif
|
||||
if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition();
|
||||
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetPosition();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition();
|
||||
return FindPlayerPed()->GetPosition();
|
||||
}
|
||||
|
||||
float
|
||||
FindPlayerHeading(void)
|
||||
{
|
||||
if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle)
|
||||
return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetForward().Heading();
|
||||
if(FindPlayerVehicle()) return FindPlayerVehicle()->GetForward().Heading();
|
||||
return FindPlayerPed()->GetForward().Heading();
|
||||
}
|
||||
|
||||
void
|
||||
CWorld::ClearCarsFromArea(float x1, float y1, float z1, float x2, float y2, float z2)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue