Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate GetBerryCountString #4012

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/item.h
Original file line number Diff line number Diff line change
@@ -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);
11 changes: 3 additions & 8 deletions src/berry.c
Original file line number Diff line number Diff line change
@@ -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;
@@ -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)
@@ -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
15 changes: 0 additions & 15 deletions src/item.c
Original file line number Diff line number Diff line change
@@ -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;