make item compile

This commit is contained in:
DizzyEggg 2018-04-29 15:34:14 +02:00
parent fd40e93cb5
commit 9f97646724
5 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,17 @@
#ifndef GUARD_ITEM_H #ifndef GUARD_ITEM_H
#define GUARD_ITEM_H #define GUARD_ITEM_H
// These constants are used in gItems
enum
{
POCKET_NONE,
POCKET_ITEMS,
POCKET_POKE_BALLS,
POCKET_TM_HM,
POCKET_BERRIES,
POCKET_KEY_ITEMS,
};
enum enum
{ {
ITEMS_POCKET, ITEMS_POCKET,

View File

@ -1218,7 +1218,7 @@ void FieldObjectInteractionRemoveBerryTree(void)
u8 PlayerHasBerries(void) u8 PlayerHasBerries(void)
{ {
return IsBagPocketNonEmpty(BAG_BERRIES); return IsBagPocketNonEmpty(POCKET_BERRIES);
} }
void ResetBerryTreeSparkleFlags(void) void ResetBerryTreeSparkleFlags(void)

View File

@ -2472,7 +2472,7 @@ static void CB2_HandleBlenderEndGame(void)
sub_8081F94(&gSendCmd[0]); sub_8081F94(&gSendCmd[0]);
if (sBerryBlenderData->yesNoAnswer == 0) if (sBerryBlenderData->yesNoAnswer == 0)
{ {
if (IsBagPocketNonEmpty(BAG_BERRIES) == FALSE) // no berries if (IsBagPocketNonEmpty(POCKET_BERRIES) == FALSE) // no berries
{ {
sBerryBlenderData->playAgainState = CANT_PLAY_NO_BERRIES; sBerryBlenderData->playAgainState = CANT_PLAY_NO_BERRIES;
gSendCmd[1] = 0x9999; gSendCmd[1] = 0x9999;

View File

@ -517,7 +517,7 @@ static void TryChangeDisplayedBerry(u8 taskId, s8 toMove)
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
s16 currPocketPosition = gUnknown_0203CE58.scrollPosition[3] + gUnknown_0203CE58.cursorPosition[3]; s16 currPocketPosition = gUnknown_0203CE58.scrollPosition[3] + gUnknown_0203CE58.cursorPosition[3];
u32 newPocketPosition = currPocketPosition + toMove; u32 newPocketPosition = currPocketPosition + toMove;
if (newPocketPosition < 46 && BagGetItemIdByPocketPosition(BAG_BERRIES, newPocketPosition) != 0) if (newPocketPosition < 46 && BagGetItemIdByPocketPosition(POCKET_BERRIES, newPocketPosition) != 0)
{ {
if (toMove < 0) if (toMove < 0)
data[1] = 2; data[1] = 2;
@ -537,7 +537,7 @@ static void HandleBagCursorPositionChange(s8 toMove)
u16 *cursorPos = &gUnknown_0203CE58.cursorPosition[3]; u16 *cursorPos = &gUnknown_0203CE58.cursorPosition[3];
if (toMove > 0) if (toMove > 0)
{ {
if (*cursorPos < 4 || BagGetItemIdByPocketPosition(BAG_BERRIES, *scrollPos + 8) == 0) if (*cursorPos < 4 || BagGetItemIdByPocketPosition(POCKET_BERRIES, *scrollPos + 8) == 0)
*cursorPos += toMove; *cursorPos += toMove;
else else
*scrollPos += toMove; *scrollPos += toMove;
@ -550,7 +550,7 @@ static void HandleBagCursorPositionChange(s8 toMove)
*scrollPos += toMove; *scrollPos += toMove;
} }
sBerryTag->berryId = ItemIdToBerryType(BagGetItemIdByPocketPosition(BAG_BERRIES, *scrollPos + *cursorPos)); sBerryTag->berryId = ItemIdToBerryType(BagGetItemIdByPocketPosition(POCKET_BERRIES, *scrollPos + *cursorPos));
} }
static void Task_DisplayAnotherBerry(u8 taskId) static void Task_DisplayAnotherBerry(u8 taskId)

View File

@ -11,17 +11,6 @@
#include "strings.h" #include "strings.h"
#include "load_save.h" #include "load_save.h"
// These constants are used in gItems
enum
{
POCKET_NONE,
POCKET_ITEMS,
POCKET_POKE_BALLS,
POCKET_TM_HM,
POCKET_BERRIES,
POCKET_KEY_ITEMS,
};
extern bool8 InBattlePyramid(void); extern bool8 InBattlePyramid(void);
extern u16 gUnknown_0203CF30[]; extern u16 gUnknown_0203CF30[];
extern const struct Item gItems[]; extern const struct Item gItems[];