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
+3 -1
View File
@@ -2,6 +2,7 @@
#include "coord.h"
#include "sound.h"
#include "functions.h"
#include "playeritem.h"
extern void (*const gUnk_0811BD98[])(ItemBehavior*, u32);
@@ -23,7 +24,8 @@ void sub_08075FF8(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.jump_status | gPlayerState.field_0x3[1]) == 0) {
bombCount = 0;
for (entity = FindEntityByID(8, 2, 2); entity != NULL; entity = FindNextDuplicateID(entity, 2)) {
for (entity = FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_BOMB, 2); entity != NULL;
entity = FindNextDuplicateID(entity, 2)) {
bombCount += 1;
}
maxBombs = this->behaviorID == 7 ? 3 : 1;
+1 -1
View File
@@ -112,7 +112,7 @@ void sub_080754B8(ItemBehavior* this, u32 arg1) {
if (gPlayerEntity.frameSpriteSettings & 1) {
iVar1 = sub_0807B014();
if (iVar1 && FindEntityByID(PLAYER_ITEM, 15, 2) == 0) {
if (iVar1 && FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_SWORD_BEAM1, 2) == 0) {
CreatePlayerBomb(this, 0xf);
if (iVar1 == 0xf) {
gPlayerState.field_0xab = 5;