Resolve review suggestions.
This commit is contained in:
+7
-7
@@ -11,7 +11,7 @@
|
||||
|
||||
EWRAM_DATA u8 gUnknown_203F464 = 0;
|
||||
|
||||
u32 sub_815EE3C(u32 * a0)
|
||||
u32 DecryptBerryPowder(u32 * a0)
|
||||
{
|
||||
return *a0 ^ gSaveBlock2Ptr->encryptionKey;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ void sub_815EE6C(u32 a0)
|
||||
|
||||
bool8 sub_815EE88(u32 a0)
|
||||
{
|
||||
if (sub_815EE3C(&gSaveBlock2Ptr->berryCrush.berryPowderAmount) < a0)
|
||||
if (DecryptBerryPowder(&gSaveBlock2Ptr->berryCrush.berryPowderAmount) < a0)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
@@ -36,7 +36,7 @@ bool8 sub_815EE88(u32 a0)
|
||||
|
||||
bool8 sub_815EEB0(void)
|
||||
{
|
||||
if (sub_815EE3C(&gSaveBlock2Ptr->berryCrush.berryPowderAmount) < gSpecialVar_0x8004)
|
||||
if (DecryptBerryPowder(&gSaveBlock2Ptr->berryCrush.berryPowderAmount) < gSpecialVar_0x8004)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
@@ -45,7 +45,7 @@ bool8 sub_815EEB0(void)
|
||||
bool8 sub_815EEE0(u32 a0)
|
||||
{
|
||||
u32 * ptr = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;
|
||||
u32 amount = sub_815EE3C(ptr) + a0;
|
||||
u32 amount = DecryptBerryPowder(ptr) + a0;
|
||||
if (amount > 99999)
|
||||
{
|
||||
SetBerryPowder(ptr, 99999);
|
||||
@@ -65,7 +65,7 @@ bool8 sub_815EF20(u32 a0)
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
u32 amount = sub_815EE3C(ptr);
|
||||
u32 amount = DecryptBerryPowder(ptr);
|
||||
SetBerryPowder(ptr, amount - a0);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ bool8 sub_815EF5C(void)
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
u32 amount = sub_815EE3C(ptr);
|
||||
u32 amount = DecryptBerryPowder(ptr);
|
||||
SetBerryPowder(ptr, amount - gSpecialVar_0x8004);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ bool8 sub_815EF5C(void)
|
||||
|
||||
u32 GetBerryPowder(void)
|
||||
{
|
||||
return sub_815EE3C(&gSaveBlock2Ptr->berryCrush.berryPowderAmount);
|
||||
return DecryptBerryPowder(&gSaveBlock2Ptr->berryCrush.berryPowderAmount);
|
||||
}
|
||||
|
||||
void sub_815EFBC(u8 windowId, u32 powder, u8 x, u8 y, u8 speed)
|
||||
|
||||
+1
-1
@@ -588,7 +588,7 @@ void DestroyWonderCard(void)
|
||||
ClearRamScript();
|
||||
sub_806E2D0();
|
||||
sub_806E370();
|
||||
sub_80E7524(gSaveBlock2Ptr->unk_4A0);
|
||||
sub_80E7524(gSaveBlock2Ptr->unk_B0.field_3F0);
|
||||
}
|
||||
|
||||
bool32 sub_8143F68(const struct MEventBuffer_32E0_Sub * data)
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ static u32 ish_mainseq_4(struct mevent_client * svr)
|
||||
sub_8069EA4(svr->recvBuffer, 1000);
|
||||
break;
|
||||
case 18:
|
||||
memcpy(gSaveBlock2Ptr->unk_4A0, svr->recvBuffer, 0xbc);
|
||||
memcpy(gSaveBlock2Ptr->unk_B0.field_3F0, svr->recvBuffer, 0xbc);
|
||||
ValidateEReaderTrainer();
|
||||
break;
|
||||
case 21:
|
||||
|
||||
@@ -281,7 +281,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx)
|
||||
bool8 MEScrCmd_addtrainer(struct ScriptContext *ctx)
|
||||
{
|
||||
u32 data = ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0];
|
||||
memcpy(gSaveBlock2Ptr->unk_4A0, (void *)data, 0xBC);
|
||||
memcpy(gSaveBlock2Ptr->unk_B0.field_3F0, (void *)data, 0xBC);
|
||||
ValidateEReaderTrainer();
|
||||
StringExpandPlaceholders(gStringVar4, gText_MysteryGiftNewTrainer);
|
||||
ctx->data[2] = 2;
|
||||
|
||||
+4
-6
@@ -29,8 +29,7 @@
|
||||
#include "script.h"
|
||||
#include "berry_powder.h"
|
||||
#include "pokemon_jump.h"
|
||||
|
||||
extern const u8 EventScript_ResetAllMapFlags[];
|
||||
#include "event_scripts.h"
|
||||
|
||||
// this file's functions
|
||||
static void ResetMiniGamesResults(void);
|
||||
@@ -78,7 +77,7 @@ static void ClearPokedexFlags(void)
|
||||
|
||||
static void sub_80549D4(void)
|
||||
{
|
||||
CpuFill32(0, &gSaveBlock2Ptr->field_B0, (u32) &gSaveBlock2Ptr->mapView - (u32) &gSaveBlock2Ptr->field_B0);
|
||||
CpuFill32(0, &gSaveBlock2Ptr->unk_B0, sizeof(gSaveBlock2Ptr->unk_B0));
|
||||
}
|
||||
|
||||
static void WarpToPlayersRoom(void)
|
||||
@@ -95,7 +94,7 @@ void Sav2_ClearSetDefault(void)
|
||||
|
||||
void ResetMenuAndMonGlobals(void)
|
||||
{
|
||||
gDifferentSaveFile = 0;
|
||||
gDifferentSaveFile = FALSE;
|
||||
ZeroPlayerPartyMons();
|
||||
ZeroEnemyPartyMons();
|
||||
sub_81089BC();
|
||||
@@ -111,7 +110,7 @@ void NewGameInitData(void)
|
||||
u8 rivalName[PLAYER_NAME_LENGTH];
|
||||
|
||||
StringCopy(rivalName, gSaveBlock1Ptr->rivalName);
|
||||
gDifferentSaveFile = 1;
|
||||
gDifferentSaveFile = TRUE;
|
||||
gSaveBlock2Ptr->encryptionKey = 0;
|
||||
ZeroPlayerPartyMons();
|
||||
ZeroEnemyPartyMons();
|
||||
@@ -160,4 +159,3 @@ static void ResetMiniGamesResults(void)
|
||||
ResetPokeJumpResults();
|
||||
CpuFill16(0, &gSaveBlock2Ptr->berryPick, sizeof(struct BerryPickingResults));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user