Refactored gym glitch fix to please Danny

This commit is contained in:
Silent 2018-01-14 01:13:27 +01:00
parent 62ed9242bc
commit 5679c66311
2 changed files with 11 additions and 11 deletions

View file

@ -1,22 +1,22 @@
#include "StdAfxSA.h"
#include "ScriptSA.h"
static int* StatTypesInt = *AddressByVersion<int**>(0x55C0D8, 0x55C578, 0x574F24);
std::pair<uint32_t,uint32_t>* CRunningScript::GetDay_GymGlitch()
int32_t* CRunningScript::GetDay_GymGlitch()
{
static std::pair<uint32_t,uint32_t> Out;
static int32_t Out[2];
if ( !strncmp(Name, "gymbike", 8) || !strncmp(Name, "gymbenc", 8) || !strncmp(Name, "gymtrea", 8) || !strncmp(Name, "gymdumb", 8) )
if ( strncmp(Name, "gymbike", 8) == 0 || strncmp(Name, "gymbenc", 8) == 0 || strncmp(Name, "gymtrea", 8) == 0 || strncmp(Name, "gymdumb", 8) == 0 )
{
Out.first = 0xFFFFFFFF;
Out.second = StatTypesInt[134-120];
static int* const StatTypesInt = *AddressByVersion<int**>(0x55C0D8, 0x55C578, 0x574F24);
Out[0] = -1;
Out[1] = StatTypesInt[134-120];
}
else
{
Out.first = nGameClockMonths;
Out.second = nGameClockDays;
Out[0] = nGameClockMonths;
Out[1] = nGameClockDays;
}
return &Out;
return Out;
}

View file

@ -67,7 +67,7 @@ private:
BYTE IsCustom;
public:
std::pair<uint32_t,uint32_t>* GetDay_GymGlitch();
int32_t* GetDay_GymGlitch();
};
static_assert(sizeof(CRunningScript) == 0xE0, "Wrong size: CRunningScript");