mirror of
https://github.com/pret/pmd-red.git
synced 2026-04-04 08:25:08 -05:00
Decomped HasItem()
This commit is contained in:
parent
edf909be4d
commit
a61f7ea2a1
2650
asm/code_8045A00.s
2650
asm/code_8045A00.s
File diff suppressed because it is too large
Load Diff
2625
asm/code_8046CE4.s
Normal file
2625
asm/code_8046CE4.s
Normal file
File diff suppressed because it is too large
Load Diff
9
include/dungeon_items.h
Normal file
9
include/dungeon_items.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef GUARD_DUNGEON_ITEMS_H
|
||||
#define GUARD_DUNGEON_ITEMS_H
|
||||
|
||||
#include "dungeon_entity.h"
|
||||
|
||||
// 0x46CB0
|
||||
bool8 HasItem(struct DungeonEntity *pokemon, u8 itemIndex);
|
||||
|
||||
#endif
|
||||
|
|
@ -192,6 +192,8 @@ SECTIONS {
|
|||
asm/code_80450F8.o(.text);
|
||||
src/dungeon_visibility.o(.text);
|
||||
asm/code_8045A00.o(.text);
|
||||
src/dungeon_items.o(.text);
|
||||
asm/code_8046CE4.o(.text);
|
||||
src/code_8048480.o(.text);
|
||||
asm/code_8048480.o(.text);
|
||||
src/dungeon_map_access.o(.text);
|
||||
|
|
|
|||
21
src/dungeon_items.c
Normal file
21
src/dungeon_items.c
Normal file
|
|
@ -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 *entityData = entityData = pokemon->entityData;
|
||||
if (!(entityData->heldItem.itemFlags & ITEM_FLAG_EXISTS))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (entityData->heldItem.itemFlags & ITEM_FLAG_STICKY)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (entityData->heldItem.itemIndex != itemIndex)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
#include "global.h"
|
||||
#include "dungeon_global_data.h"
|
||||
#include "dungeon_pokemon_attributes_1.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
#include "constants/dungeon.h"
|
||||
#include "constants/iq_skill.h"
|
||||
#include "constants/move_id.h"
|
||||
#include "constants/status.h"
|
||||
#include "constants/tactic.h"
|
||||
#include "dungeon_global_data.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokemon_3.h"
|
||||
|
||||
extern s16 gItemMasterMinWildLevel;
|
||||
|
||||
extern u8 HasItem(struct DungeonEntity *, u32);
|
||||
|
||||
extern bool8 IsIQSkillSet(u8 *, u32);
|
||||
extern void SetIQSkill(u8 *param_1, u32 skillIndex);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user