Skip to content

Commit

Permalink
Deprecate GetBerryCountString (#4012)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex <[email protected]>
  • Loading branch information
Bassoonian and AlexOn1ine authored Jan 18, 2024
1 parent 9efdd9e commit 1aff650
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
1 change: 0 additions & 1 deletion include/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ void ApplyNewEncryptionKeyToBagItems_(u32 newKey);
void SetBagItemsPointers(void);
void CopyItemName(u16 itemId, u8 *dst);
void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity);
void GetBerryCountString(u8 *dst, const u8 *berryName, u32 quantity);
bool8 IsBagPocketNonEmpty(u8 pocket);
bool8 CheckBagHasItem(u16 itemId, u16 count);
bool8 HasAtLeastOneBerry(void);
Expand Down
11 changes: 3 additions & 8 deletions src/berry.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,11 +1982,6 @@ void GetBerryNameByBerryType(u8 berry, u8 *string)
string[BERRY_NAME_LENGTH] = EOS;
}

void GetBerryCountStringByBerryType(u8 berry, u8 *dest, u32 berryCount)
{
GetBerryCountString(dest, GetBerryInfo(berry)->name, berryCount);
}

void AllowBerryTreeGrowth(u8 id)
{
GetBerryTreeInfo(id)->stopGrowth = FALSE;
Expand Down Expand Up @@ -2122,7 +2117,7 @@ void ObjectEventInteractionGetBerryTreeData(void)
gSpecialVar_0x8004 = GetStageByBerryTreeId(id);
gSpecialVar_0x8005 = GetNumStagesWateredByBerryTreeId(id);
gSpecialVar_0x8006 = GetBerryCountByBerryTreeId(id);
GetBerryCountStringByBerryType(berry, gStringVar1, gSpecialVar_0x8006);
CopyItemNameHandlePlural(BerryTypeToItemId(berry), gStringVar1, gSpecialVar_0x8006);
}

void ObjectEventInteractionGetBerryName(void)
Expand All @@ -2136,12 +2131,12 @@ void ObjectEventInteractionGetBerryCountString(void)
u8 treeId = GetObjectEventBerryTreeId(gSelectedObjectEvent);
u8 berry = GetBerryTypeByBerryTreeId(treeId);
u8 count = GetBerryCountByBerryTreeId(treeId);
GetBerryCountStringByBerryType(berry, gStringVar1, count);
CopyItemNameHandlePlural(BerryTypeToItemId(berry), gStringVar1, count);
berry = GetTreeMutationValue(treeId);
if (berry > 0)
{
count = 1;
GetBerryCountStringByBerryType(berry, gStringVar3, count);
CopyItemNameHandlePlural(BerryTypeToItemId(berry), gStringVar3, count);
gSpecialVar_Result = TRUE;
}
else
Expand Down
15 changes: 0 additions & 15 deletions src/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,6 @@ void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity)
StringAppend(end, sText_s);
}

void GetBerryCountString(u8 *dst, const u8 *berryName, u32 quantity)
{
const u8 *berryString;
u8 *txtPtr;

if (quantity < 2)
berryString = gText_Berry;
else
berryString = gText_Berries;

txtPtr = StringCopy(dst, berryName);
*txtPtr = CHAR_SPACE;
StringCopy(txtPtr + 1, berryString);
}

bool8 IsBagPocketNonEmpty(u8 pocket)
{
u8 i;
Expand Down

0 comments on commit 1aff650

Please sign in to comment.