summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-02-18 18:18:40 +0200
committerTal Hayon <talhayon1@gmail.com>2022-02-18 18:18:40 +0200
commit0e224cf2323a76539730ee35f4e8a0856cf7a1fd (patch)
tree4153b4359e569ce555626b85c63a0533d26eb348 /src/object
parent10f8096abd9533e14a5ad03eedcbee4fcbb9019a (diff)
Add playeritem enum and use ids and kinds in all Findentity calls
Diffstat (limited to 'src/object')
-rw-r--r--src/object/book.c3
-rw-r--r--src/object/greatFairy.c4
-rw-r--r--src/object/object6A.c12
3 files changed, 10 insertions, 9 deletions
diff --git a/src/object/book.c b/src/object/book.c
index c0003115..3cea262b 100644
--- a/src/object/book.c
+++ b/src/object/book.c
@@ -2,6 +2,7 @@
#include "functions.h"
#include "message.h"
#include "item.h"
+#include "npc.h"
extern void (*const BookActionFuncs[])(Entity*);
extern s8 const gUnk_08123D94[];
@@ -152,7 +153,7 @@ void sub_0809B5EC(Entity* this) {
switch (this->subAction) {
case 0: {
Entity* parent;
- parent = FindEntityByID(7, 26, 7);
+ parent = FindEntityByID(NPC, STURGEON, 7);
if (!parent) {
return;
}
diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c
index a0e29797..a03d9344 100644
--- a/src/object/greatFairy.c
+++ b/src/object/greatFairy.c
@@ -517,7 +517,7 @@ void sub_080873FC(void) {
SoundReq(SFX_APPARATE);
gRoomControls.camera_target = NULL;
- while (ent = FindEntityByID(0x6, 0x1b, 0x6), ent != NULL) {
+ while (ent = FindEntityByID(OBJECT, GREAT_FAIRY, 0x6), ent != NULL) {
DeleteEntity(ent);
}
}
@@ -546,7 +546,7 @@ void sub_08087424(Entity* this, ScriptExecutionContext* context) {
void sub_0808747C(Entity* this, ScriptExecutionContext* context) {
u32 iVar1 = 0;
- iVar1 = (u32)FindEntity(0x6, 0xf, 0x6, 0xb, 0x0);
+ iVar1 = (u32)FindEntity(OBJECT, SPECIAL_FX, 0x6, 0xb, 0x0);
if (iVar1 != 0) {
iVar1 = 1;
}
diff --git a/src/object/object6A.c b/src/object/object6A.c
index 0d2fb68e..2b655443 100644
--- a/src/object/object6A.c
+++ b/src/object/object6A.c
@@ -195,7 +195,7 @@ void sub_08094B94(Object6AEntity* this) {
}
void sub_08094BE0(Entity* this) {
- Entity* e = FindEntity(6, OBJECT_6A, 6, 0x22, 0);
+ Entity* e = FindEntity(OBJECT, OBJECT_6A, 6, 0x22, 0);
if (e != NULL) {
CopyPosition(&gPlayerEntity, e);
e->z.HALF.HI = -12;
@@ -257,14 +257,14 @@ void sub_08094CDC(Object6AEntity* this) {
}
void sub_08094D10(Object6AEntity* this) {
- Entity* e = FindEntity(6, 0x6a, 6, 3, 98);
+ Entity* e = FindEntity(OBJECT, OBJECT_6A, 6, 3, 98);
if (e != NULL) {
e->action = 0xFF;
}
}
void sub_08094D34(Object6AEntity* this) {
- Entity* e = CreateObject(0x6a, 0x15, 0xd);
+ Entity* e = CreateObject(OBJECT_6A, 0x15, 0xd);
if (e != NULL) {
e->x.HALF.HI = gRoomControls.origin_x + Q_8_8(1.0);
e->y.HALF.HI = gRoomControls.origin_y + Q_8_8(2.345);
@@ -273,7 +273,7 @@ void sub_08094D34(Object6AEntity* this) {
}
void sub_08094D70(Object6AEntity* this) {
- Entity* e = FindEntity(6, 0x6a, 6, 0x15, 0xd);
+ Entity* e = FindEntity(OBJECT, OBJECT_6A, 6, 0x15, 0xd);
if (e != NULL) {
e->action = 0xFF;
}
@@ -306,7 +306,7 @@ void sub_08094DD8(Object6AEntity* this) {
}
void sub_08094E0C(Object6AEntity* this) {
- Entity* e = FindEntity(6, 0x6a, 6, 4, 0);
+ Entity* e = FindEntity(OBJECT, OBJECT_6A, 6, 4, 0);
if (e != NULL) {
e->action = 0xFF;
}
@@ -483,7 +483,7 @@ void sub_08095120(Object6AEntity* this) {
}
void sub_08095164(Object6AEntity* this) {
- Entity* e = FindEntity(6, 0x6A, 6, 8, 0);
+ Entity* e = FindEntity(OBJECT, OBJECT_6A, 6, 8, 0);
if (e != NULL) {
InitAnimationForceUpdate(e, 3);
}