Add playeritem enum and use ids and kinds in all Findentity calls

This commit is contained in:
Tal Hayon
2022-02-18 18:18:40 +02:00
parent 10f8096abd
commit 0e224cf232
20 changed files with 81 additions and 43 deletions
+2 -1
View File
@@ -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;
}
+2 -2
View File
@@ -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;
}
+6 -6
View File
@@ -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);
}