Skip to content

Commit

Permalink
Merge pull request #39 from rglezg/fix/38_HM_malfunction
Browse files Browse the repository at this point in the history
Add missing check for HM item.
  • Loading branch information
rglezg authored Jul 24, 2021
2 parents 720e181 + 93b9336 commit d83df08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/field_player_avatar.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "field_effect_helpers.h"
#include "field_player_avatar.h"
#include "fieldmap.h"
#include "item.h"
#include "menu.h"
#include "metatile_behavior.h"
#include "overworld.h"
Expand Down Expand Up @@ -1284,7 +1285,7 @@ bool8 PartyHasMonWithSurf(void)
{
u8 i;

if (!TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING))
if (!TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING) && CheckBagHasItem(ITEM_HM03_SURF, 1))
{
for (i = 0; i < PARTY_SIZE; i++)
{
Expand All @@ -1302,6 +1303,8 @@ void CheckPlayerHasMonWithHM(u16 hm)
u8 i;

gSpecialVar_Result = PARTY_SIZE;
if (!CheckBagHasItem(hm, 1))
return;
for (i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL);
Expand Down

0 comments on commit d83df08

Please sign in to comment.