fixed potential undefined behaviour when using escape rope (#4705)
This commit is contained in:
parent
658b437777
commit
7404d03ea9
1 changed files with 4 additions and 8 deletions
|
@ -1041,14 +1041,10 @@ static void ItemUseOnFieldCB_EscapeRope(u8 taskId)
|
|||
{
|
||||
Overworld_ResetStateAfterDigEscRope();
|
||||
if (I_KEY_ESCAPE_ROPE < GEN_8)
|
||||
{
|
||||
RemoveUsedItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
|
||||
CopyItemName(gSpecialVar_ItemId, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_PlayerUsedVar2);
|
||||
}
|
||||
gTasks[taskId].data[0] = 0;
|
||||
DisplayItemMessageOnField(taskId, gStringVar4, Task_UseDigEscapeRopeOnField);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue