mirror of
https://github.com/halpz/re3.git
synced 2025-07-04 14:20:49 +00:00
CPlayerPed continues (#294)
This commit is contained in:
@ -1379,6 +1379,21 @@ CCamera::SetWideScreenOff(void)
|
||||
m_bWantsToSwitchWidescreenOff = m_WideScreenOn;
|
||||
}
|
||||
|
||||
void
|
||||
CCamera::SetNewPlayerWeaponMode(int16 mode, int16 minZoom, int16 maxZoom)
|
||||
{
|
||||
PlayerWeaponMode.Mode = mode;
|
||||
PlayerWeaponMode.MaxZoom = maxZoom;
|
||||
PlayerWeaponMode.MinZoom = minZoom;
|
||||
PlayerWeaponMode.Duration = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
CCamera::UpdateAimingCoors(CVector const &coors)
|
||||
{
|
||||
m_cvecAimingTargetCoors = coors;
|
||||
}
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x42C760, (bool (CCamera::*)(const CVector ¢er, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP);
|
||||
InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP);
|
||||
|
@ -494,6 +494,8 @@ int m_iModeObbeCamIsInForCar;
|
||||
void SetCameraDirectlyBehindForFollowPed_CamOnAString(void);
|
||||
void SetZoomValueFollowPedScript(int16);
|
||||
void SetZoomValueCamStringScript(int16);
|
||||
void SetNewPlayerWeaponMode(int16, int16, int16);
|
||||
void UpdateAimingCoors(CVector const &);
|
||||
|
||||
void dtor(void) { this->CCamera::~CCamera(); }
|
||||
};
|
||||
|
@ -212,9 +212,9 @@ CPlayerInfo::IsRestartingAfterArrest()
|
||||
return m_WBState == WBSTATE_BUSTED;
|
||||
}
|
||||
|
||||
// lastClosestness is passed to other calls of this function
|
||||
// lastCloseness is passed to other calls of this function
|
||||
void
|
||||
CPlayerInfo::EvaluateCarPosition(CEntity *carToTest, CPed *player, float carBoundCentrePedDist, float *lastClosestness, CVehicle **closestCarOutput)
|
||||
CPlayerInfo::EvaluateCarPosition(CEntity *carToTest, CPed *player, float carBoundCentrePedDist, float *lastCloseness, CVehicle **closestCarOutput)
|
||||
{
|
||||
// This dist used for determining the angle to face
|
||||
CVector2D dist(carToTest->GetPosition() - player->GetPosition());
|
||||
@ -229,9 +229,9 @@ CPlayerInfo::EvaluateCarPosition(CEntity *carToTest, CPed *player, float carBoun
|
||||
|
||||
// This dist used for evaluating cars' distances, weird...
|
||||
// Accounts inverted needed turn (or needed turn in long way) and car dist.
|
||||
float closestness = (1.0f - Abs(neededTurn) / TWOPI) * (10.0f - carBoundCentrePedDist);
|
||||
if (closestness > *lastClosestness) {
|
||||
*lastClosestness = closestness;
|
||||
float closeness = (1.0f - Abs(neededTurn) / TWOPI) * (10.0f - carBoundCentrePedDist);
|
||||
if (closeness > *lastCloseness) {
|
||||
*lastCloseness = closeness;
|
||||
*closestCarOutput = (CVehicle*)carToTest;
|
||||
}
|
||||
}
|
||||
@ -312,7 +312,7 @@ INITSAVEBUF
|
||||
}
|
||||
|
||||
void
|
||||
CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1, float unk2, float unk3, float unk4, float* lastClosestness, CVehicle** closestCarOutput)
|
||||
CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1, float unk2, float unk3, float unk4, float* lastCloseness, CVehicle** closestCarOutput)
|
||||
{
|
||||
for (CPtrNode* node = carList.first; node; node = node->next) {
|
||||
CVehicle *car = (CVehicle*)node->item;
|
||||
@ -328,7 +328,7 @@ CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1,
|
||||
if (Abs(ped->GetPosition().z - carCentre.z) < 2.0f) {
|
||||
float dist = (ped->GetPosition() - carCentre).Magnitude2D();
|
||||
if (dist <= 10.0f && !CCranes::IsThisCarBeingCarriedByAnyCrane(car)) {
|
||||
EvaluateCarPosition(car, ped, dist, lastClosestness, closestCarOutput);
|
||||
EvaluateCarPosition(car, ped, dist, lastCloseness, closestCarOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -434,7 +434,7 @@ CPlayerInfo::Process(void)
|
||||
// Enter vehicle
|
||||
if (CPad::GetPad(0)->ExitVehicleJustDown()) {
|
||||
bool weAreOnBoat = false;
|
||||
float lastClosestness = 0.0f;
|
||||
float lastCloseness = 0.0f;
|
||||
CVehicle *carBelow = nil;
|
||||
CEntity *surfaceBelow = m_pPed->m_pCurrentPhysSurface;
|
||||
if (surfaceBelow && surfaceBelow->IsVehicle()) {
|
||||
@ -472,9 +472,9 @@ CPlayerInfo::Process(void)
|
||||
for (int curX = minXSector; curX <= maxXSector; curX++) {
|
||||
CSector *sector = CWorld::GetSector(curX, curY);
|
||||
FindClosestCarSectorList(sector->m_lists[ENTITYLIST_VEHICLES], m_pPed,
|
||||
minX, minY, maxX, maxY, &lastClosestness, &carBelow);
|
||||
minX, minY, maxX, maxY, &lastCloseness, &carBelow);
|
||||
FindClosestCarSectorList(sector->m_lists[ENTITYLIST_VEHICLES_OVERLAP], m_pPed,
|
||||
minX, minY, maxX, maxY, &lastClosestness, &carBelow);
|
||||
minX, minY, maxX, maxY, &lastCloseness, &carBelow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user