Re3/src/core/PlayerInfo.cpp

47 lines
1.1 KiB
C++
Raw Normal View History

2019-06-14 19:34:19 -04:00
#include "common.h"
#include "patcher.h"
2019-07-25 16:34:29 -04:00
#include "PlayerPed.h"
2019-06-14 19:34:19 -04:00
#include "PlayerInfo.h"
2019-07-10 03:57:08 -04:00
#include "Frontend.h"
2019-07-25 16:34:29 -04:00
#include "Vehicle.h"
2019-09-28 14:39:58 -04:00
#include "PlayerSkin.h"
2019-07-03 18:16:24 -04:00
2019-07-09 17:49:44 -04:00
WRAPPER void CPlayerInfo::MakePlayerSafe(bool) { EAXJMP(0x4A1400); }
WRAPPER void CPlayerInfo::AwardMoneyForExplosion(CVehicle *vehicle) { EAXJMP(0x4A15F0); }
2019-09-11 20:43:18 -04:00
WRAPPER void CPlayerInfo::Process(void) { EAXJMP(0x49FD30); }
2019-07-10 03:57:08 -04:00
void CPlayerInfo::SetPlayerSkin(char *skin)
{
strncpy(m_aSkinName, skin, 32);
LoadPlayerSkin();
}
2019-07-25 16:34:29 -04:00
CVector& CPlayerInfo::GetPos()
{
if (m_pPed->bInVehicle && m_pPed->m_pMyVehicle)
return m_pPed->m_pMyVehicle->GetPosition();
return m_pPed->GetPosition();
}
2019-09-28 14:39:58 -04:00
void CPlayerInfo::LoadPlayerSkin()
{
DeletePlayerSkin();
m_pSkinTexture = CPlayerSkin::GetSkinTexture(m_aSkinName);
if (!m_pSkinTexture)
m_pSkinTexture = CPlayerSkin::GetSkinTexture(DEFAULT_SKIN_NAME);
}
void CPlayerInfo::DeletePlayerSkin()
{
if (m_pSkinTexture) {
RwTextureDestroy(m_pSkinTexture);
m_pSkinTexture = NULL;
}
}
STARTPATCHES
InjectHook(0x4A1700, &CPlayerInfo::LoadPlayerSkin, PATCH_JUMP);
InjectHook(0x4A1750, &CPlayerInfo::DeletePlayerSkin, PATCH_JUMP);
ENDPATCHES