Skip to content

Commit

Permalink
Little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Feb 4, 2025
1 parent 7fb152c commit ed00c97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions Client/game_sa/CVehicleSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,12 +910,6 @@ void CVehicleSA::SetEngineOn(bool bEngineOn)
}
}

bool CVehicleSA::IsPassenger(CPed* pPed)
{
using FUNC_CVehicle_IsPassenger_t = bool(__thiscall*)(CVehicleSAInterface* self, CPedSAInterface* ped);
return ((FUNC_CVehicle_IsPassenger_t)(FUNC_CVehicle_IsPassenger))(GetVehicleInterface(), pPed->GetPedInterface());
}

CPed* CVehicleSA::GetDriver()
{
CPoolsSA* pPools = (CPoolsSA*)pGame->GetPools();
Expand Down
6 changes: 5 additions & 1 deletion Client/game_sa/CVehicleSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ class CVehicleSAInterface : public CPhysicalSAInterface
((void(__thiscall*)(CVehicleSAInterface*, RwFrame*, std::uint32_t))0x6D2700)(this, component, state);
}

bool IsPassenger(CPedSAInterface* ped) const noexcept {
return ((bool(__thiscall*)(CVehicleSAInterface const*, CPedSAInterface*))0x6D1BD0)(this, ped);
}

CAEVehicleAudioEntitySAInterface m_VehicleAudioEntity; // 312

tHandlingDataSA* pHandlingData; // +900
Expand Down Expand Up @@ -476,7 +480,7 @@ class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA
void SetRailTrack(BYTE ucTrackID);
float GetTrainPosition();
void SetTrainPosition(float fPosition, bool bRecalcOnRailDistance = true);
bool IsPassenger(CPed* pPed);
bool IsPassenger(CPed* pPed) noexcept { return GetVehicleInterface()->IsPassenger(pPed->GetPedInterface()); };

void AddVehicleUpgrade(DWORD dwModelID);
void RemoveVehicleUpgrade(DWORD dwModelID);
Expand Down

0 comments on commit ed00c97

Please sign in to comment.