CPlayerInfo operator= (for SA 1.0

This commit is contained in:
Silent 2018-01-26 18:18:36 +01:00
parent d93a5d6fc6
commit 5ad460ff40
3 changed files with 13 additions and 1 deletions

View file

@ -37,4 +37,10 @@ CVehicle* FindPlayerVehicle( int playerID, bool withRC )
vehicle = ped->GetVehiclePtr();
}
return vehicle;
}
}
CPlayerInfo& CPlayerInfo::operator=( const CPlayerInfo& rhs )
{
memcpy( this, &rhs, sizeof(*this) );
return *this;
}

View file

@ -12,6 +12,8 @@ private:
uint8_t __pad[0xDC];
public:
CPlayerInfo& operator=( const CPlayerInfo& rhs );
CPlayerPed* GetPlayerPed() const { return m_pPed; }
CVehicle* GetControlledVehicle() const { return m_pControlledVehicle; }
};

View file

@ -3438,6 +3438,10 @@ void Patch_SA_10()
// Correct streaming when using RC vehicles
InjectHook( 0x55574B, FindPlayerEntityWithRC );
InjectHook( 0x5557C3, FindPlayerVehicle_RCWrap );
// Fixed CPlayerInfo assignment operator
InjectHook( 0x45DEF0, &CPlayerInfo::operator=, PATCH_JUMP );
}
void Patch_SA_11()