summaryrefslogtreecommitdiff
path: root/src/dungeon_items.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2022-01-07 16:30:55 -0800
committerGitHub <noreply@github.com>2022-01-07 16:30:55 -0800
commit3cdde2a92a187d437dc7d24273177b59ab5b9511 (patch)
tree2d5924a28e208e14d302c24f9ea5f0a17a8e81a2 /src/dungeon_items.c
parentedf909be4da55a435bf81f96ffcbd156b2120562 (diff)
parent42bcb068b61656f083009816b927207393a35b10 (diff)
Merge pull request #92 from AnonymousRandomPerson/master
More item AI decomp
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;
+}