summaryrefslogtreecommitdiff
path: root/src/dungeon_items.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dungeon_items.c')
-rw-r--r--src/dungeon_items.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/dungeon_items.c b/src/dungeon_items.c
new file mode 100644
index 0000000..bfaab53
--- /dev/null
+++ b/src/dungeon_items.c
@@ -0,0 +1,21 @@
+#include "global.h"
+#include "dungeon_items.h"
+
+bool8 HasItem(struct DungeonEntity *pokemon, u8 itemIndex)
+{
+ // Weird assignment to fix a regswap.
+ struct DungeonEntityData *pokemonData = pokemonData = pokemon->entityData;
+ if (!(pokemonData->heldItem.itemFlags & ITEM_FLAG_EXISTS))
+ {
+ return FALSE;
+ }
+ if (pokemonData->heldItem.itemFlags & ITEM_FLAG_STICKY)
+ {
+ return FALSE;
+ }
+ if (pokemonData->heldItem.itemIndex != itemIndex)
+ {
+ return FALSE;
+ }
+ return TRUE;
+}