From 5679c6631129370abddc5b9705b485aac7563f60 Mon Sep 17 00:00:00 2001 From: Silent Date: Sun, 14 Jan 2018 01:13:27 +0100 Subject: [PATCH] Refactored gym glitch fix to please Danny --- SilentPatchSA/ScriptSA.cpp | 20 ++++++++++---------- SilentPatchSA/ScriptSA.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/SilentPatchSA/ScriptSA.cpp b/SilentPatchSA/ScriptSA.cpp index 2158e07..e6bba4c 100644 --- a/SilentPatchSA/ScriptSA.cpp +++ b/SilentPatchSA/ScriptSA.cpp @@ -1,22 +1,22 @@ #include "StdAfxSA.h" #include "ScriptSA.h" -static int* StatTypesInt = *AddressByVersion(0x55C0D8, 0x55C578, 0x574F24); - -std::pair* CRunningScript::GetDay_GymGlitch() +int32_t* CRunningScript::GetDay_GymGlitch() { - static std::pair 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(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; } \ No newline at end of file diff --git a/SilentPatchSA/ScriptSA.h b/SilentPatchSA/ScriptSA.h index 63893c1..60a95bf 100644 --- a/SilentPatchSA/ScriptSA.h +++ b/SilentPatchSA/ScriptSA.h @@ -67,7 +67,7 @@ private: BYTE IsCustom; public: - std::pair* GetDay_GymGlitch(); + int32_t* GetDay_GymGlitch(); }; static_assert(sizeof(CRunningScript) == 0xE0, "Wrong size: CRunningScript");