Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion injector/injector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace injector
template <valid_pointer_type T>
explicit auto_pointer(T x) : p(to_void_pointer(x)) {}

bool is_null() const { return this->p != nullptr; }
bool is_null() const { return this->p == nullptr; }

#if __cplusplus >= 201103L || _MSC_VER >= 1800
explicit operator bool() const { return is_null(); }
Expand Down
6 changes: 3 additions & 3 deletions plugin_sa/game_sa/CCullZones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ void CCullZones::Update() {
}

void CCullZones::AddCullZone(const CVector& center, float unk1, float fWidthY, float fBottomZ, float fWidthX, float unk2, float fTopZ, ushort flags) {
plugin::Call<0x72DF70>();
plugin::Call<0x72DF70>(center, unk1, fWidthY, fBottomZ, fWidthX, unk2, fTopZ, flags);
}

void CCullZones::AddTunnelAttributeZone(const CVector& center, float unk1, float fWidthY, float fBottomZ, float fWidthX, float unk2, float fTopZ, ushort flags) {
plugin::Call<0x72DB50>();
plugin::Call<0x72DB50>(center, unk1, fWidthY, fBottomZ, fWidthX, unk2, fTopZ, flags);
}

void CCullZones::AddMirrorAttributeZone(const CVector& center, float unk1, float fWidthY, float fBottomZ, float fWidthX, float unk2, float fTopZ, eZoneAttributes flags, float cm, float vX, float vY, float vZ) {
plugin::Call<0x72DC10>();
plugin::Call<0x72DC10>(center, unk1, fWidthY, fBottomZ, fWidthX, unk2, fTopZ, flags, cm, vX, vY, vZ);
}

bool CCullZones::InRoomForAudio() {
Expand Down
3 changes: 0 additions & 3 deletions plugin_sa/game_sa/CDummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@
class PLUGIN_API CDummy : public CEntity {
public:
};
VALIDATE_SIZE(CDummy, 0x38);


VALIDATE_SIZE(CDummy, 0x38);
3 changes: 0 additions & 3 deletions plugin_sa/game_sa/CDummyObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@
class PLUGIN_API CDummyObject : public CDummy {
public:
};
VALIDATE_SIZE(CDummyObject, 0x38);


VALIDATE_SIZE(CDummyObject, 0x38);
4 changes: 2 additions & 2 deletions plugin_sa/game_sa/CGangWars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ bool CGangWars::CreateAttackWave(int warFerocity, int waveID) {
int addrof(CGangWars::CreateDefendingGroup) = ADDRESS_BY_VERSION(0x4453D0, 0, 0, 0, 0, 0);
int gaddrof(CGangWars::CreateDefendingGroup) = GLOBAL_ADDRESS_BY_VERSION(0x4453D0, 0, 0, 0, 0, 0);

bool CGangWars::CreateDefendingGroup(int unsued) {
return plugin::CallAndReturnDynGlobal<bool, int>(gaddrof(CGangWars::CreateDefendingGroup), unsued);
bool CGangWars::CreateDefendingGroup(int unused) {
return plugin::CallAndReturnDynGlobal<bool, int>(gaddrof(CGangWars::CreateDefendingGroup), unused);
}

int addrof(CGangWars::DoStuffWhenPlayerVictorious) = ADDRESS_BY_VERSION(0x446400, 0, 0, 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CGangWars.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PLUGIN_API CGangWars {
SUPPORTED_10US static void ClearSpecificZonesToTriggerGangWar();
SUPPORTED_10US static void ClearTheStreets();
SUPPORTED_10US static bool CreateAttackWave(int warFerocity, int waveID);
SUPPORTED_10US static bool CreateDefendingGroup(int unsued);
SUPPORTED_10US static bool CreateDefendingGroup(int unused);
SUPPORTED_10US static void DoStuffWhenPlayerVictorious();
//! unused
SUPPORTED_10US static bool DoesPlayerControlThisZone(CZoneInfo *zoneinfo);
Expand Down
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CGarages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ bool CGarages::Load() {
}

bool CGarages::Save() {
return plugin::CallAndReturn<bool, 0x5D3270>();
return plugin::CallAndReturn<bool, 0x5D3160>();
}
4 changes: 2 additions & 2 deletions plugin_sa/game_sa/CMenuManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ bool CMenuManager::CheckRedefineControlInput() {
}

void CMenuManager::CheckSliderMovement(float input) {
plugin::CallMethod<0x57E4D0, CMenuManager*>(this, input);
plugin::CallMethod<0x573440, CMenuManager*>(this, input);
}

void CMenuManager::DisplayHelperText(char* text) {
plugin::CallMethod<0x57E4D0, CMenuManager*>(this, text);
plugin::CallMethod<0x57E240, CMenuManager*>(this, text);
}

int CMenuManager::DisplaySlider(float posX, float posY, float beginHeight, float endHeight, float distBetweenRects, float filledAmount, CRGBA const& colour) {
Expand Down
4 changes: 2 additions & 2 deletions plugin_sa/game_sa/CMenuSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void CMenuSystem::DisplayGridMenu(unsigned char panelId, bool bBrightFont)

void CMenuSystem::HighlightOneItem(unsigned char panelId, unsigned char itemId, bool bHighlight)
{
((void (__cdecl *)(unsigned char, unsigned char, bool))0x5816E0)(panelId, itemId, bHighlight);
((void (__cdecl *)(unsigned char, unsigned char, bool))0x581C10)(panelId, itemId, bHighlight);
}

tMenuPanel** CMenuSystem::InsertMenu(unsigned char panelId, unsigned char columnId, char *pTitle, char *str1, char *str2, char *str3, char *str4, char *str5, char *str6, char *str7, char *str8, char *str9, char *str10, char *str11, char *str12)
Expand All @@ -88,7 +88,7 @@ tMenuPanel* CMenuSystem::InsertOneMenuItemWithNumber(unsigned char panelId, unsi

void CMenuSystem::SetActiveMenuItem(unsigned char panelId, char rowId)
{
((void (__cdecl *)(unsigned char, char))0x582630)(panelId, rowId);
((void (__cdecl *)(unsigned char, char))0x5820C0)(panelId, rowId);
}

void CMenuSystem::SetColumnHeader(unsigned char panelId, unsigned char columnId, char *str)
Expand Down
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CModelInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ bool CModelInfo::IsHeliModel(int modelId) {
return ((bool (__cdecl*)(int))0x4C5B00)(modelId);
}

static bool IsMonsterTruckModel(int modelId) {
bool CModelInfo::IsMonsterTruckModel(int modelId) {
return ((bool (__cdecl*)(int))0x4C5BC0)(modelId);
}

Expand Down
4 changes: 2 additions & 2 deletions plugin_sa/game_sa/CPad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ bool CPad::ExitVehicleJustDown() {
}

// Converted from thiscall uchar CPad::GetMeleeAttack(void) 0x540340
unsigned char CPad::GetMeleeAttack() {
return plugin::CallMethodAndReturn<unsigned char, 0x540340, CPad *>(this, 0);
unsigned char CPad::GetMeleeAttack(bool checkButtonCircleStateOnly) {
return plugin::CallMethodAndReturn<unsigned char, 0x540340, CPad *>(this, checkButtonCircleStateOnly);
}

// Converted from thiscall uchar CPad::MeleeAttackJustDown(void) 0x540390
Expand Down
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CPad.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class CPad {
short GetBrake();
bool GetExitVehicle();
bool ExitVehicleJustDown();
unsigned char GetMeleeAttack();
unsigned char GetMeleeAttack(bool checkButtonCircleStateOnly = false);
unsigned char MeleeAttackJustDown();
short GetAccelerate();
bool GetAccelerateJustDown();
Expand Down
16 changes: 12 additions & 4 deletions plugin_sa/game_sa/CPlaceable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,18 @@ void CPlaceable::GetOrientation(float& x, float& y, float& z)
x = asinf(this->m_matrix->up.z);

float cosx = cosf(x);
float cosy = this->m_matrix->at.z / cosx;
y = acosf(cosy);
float cosz = this->m_matrix->up.y / cosx;
z = acosf(cosz);
if (cosx != 0.0f)
{
float cosy = this->m_matrix->at.z / cosx;
y = acosf(cosy);
float cosz = this->m_matrix->up.y / cosx;
z = acosf(cosz);
}
else
{
y = 0.0f;
z = 0.0f;
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CPostEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void CPostEffects::ColourFilter(RwRGBA col1, RwRGBA col2) {

// 0x702080
void CPostEffects::Radiosity(int32_t intensityLimit, int32_t filterPasses, int32_t renderPasses, int32_t intensity) {
plugin::Call<0x702080>();
plugin::Call<0x702080, int32_t>(intensityLimit, filterPasses, renderPasses, intensity);
}

// 0x700BE0
Expand Down
4 changes: 2 additions & 2 deletions plugin_sa/game_sa/CRestart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ void CRestart::OverrideNextRestart(CVector const& point, float angle)

void CRestart::Save()
{
((void(__cdecl *)())0x460780)();
((void(__cdecl *)())0x5D3620)();
}

void CRestart::SetRespawnPointForDurationOfMission(CVector point)
{
((void(__cdecl *)())0x460780)();
((void(__cdecl *)(CVector))0x460810)(point);
}
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CStore {
}

ObjectType* Alloc() {
if (count <= Capacity)
if (count < Capacity)
return &objects[count++];

return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CStuntJumpManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ bool CStuntJumpManager::Save() {

// 0x5D5920
bool CStuntJumpManager::Load() {
return plugin::CallAndReturn<bool, 0x5D5570>();
return plugin::CallAndReturn<bool, 0x5D5920>();
}
4 changes: 2 additions & 2 deletions plugin_sa/game_sa/CVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,9 @@ void CVehicle::RemoveReplacementUpgrade(int nodeId)
}

// Converted from thiscall void CVehicle::GetReplacementUpgrade(int nodeId) 0x6D3A50
void CVehicle::GetReplacementUpgrade(int nodeId)
int CVehicle::GetReplacementUpgrade(int nodeId)
{
((void (__thiscall *)(CVehicle*, int))0x6D3A50)(this, nodeId);
return ((int (__thiscall *)(CVehicle*, int))0x6D3A50)(this, nodeId);
}

// Converted from thiscall void CVehicle::RemoveAllUpgrades(void) 0x6D3AB0
Expand Down
2 changes: 1 addition & 1 deletion plugin_sa/game_sa/CVehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ class PLUGIN_API CVehicle : public CPhysical {
void AddReplacementUpgrade(int modelIndex, int nodeId);
void RemoveReplacementUpgrade(int nodeId);
// return upgrade model id or -1 if not present
void GetReplacementUpgrade(int nodeId);
int GetReplacementUpgrade(int nodeId);
void RemoveAllUpgrades();
int GetSpareHasslePosId();
void SetHasslePosId(int hasslePos, bool enable);
Expand Down