diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 7335c5ba..fe11ad34 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -1568,7 +1568,7 @@ void Cutscene_DropVsItem(Player* player, ObjectId itemId, Item* item) { item->obj.pos.y = player->pos.y; item->obj.pos.z = player->trueZpos; item->obj.id = itemId; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); } } diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 0d184d14..9647c9ad 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -277,7 +277,7 @@ void Item_Load(Item* this, ObjectInit* objInit) { this->obj.rot.z = objInit->rot.z; this->obj.id = objInit->id; this->width = 1.0f; - CALL_CANCELLABLE_EVENT(ItemDropEvent, this){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, this) { Object_SetInfo(&this->info, this->obj.id); } } @@ -1045,10 +1045,10 @@ void Scenery_CoStoneArch_Init(CoStoneArch* this, f32* hitboxData) { item->obj.pos.y = this->obj.pos.y; item->obj.pos.z = this->obj.pos.z; item->obj.rot.y = this->obj.rot.y; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + item->info.hitbox = LOAD_ASSET(hitboxData); + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); } - item->info.hitbox = LOAD_ASSET(hitboxData); break; } } @@ -1701,23 +1701,23 @@ void func_enmy_800660F0(Actor* this) { item->obj.pos.z = this->obj.pos.z; item->timer_4A = 8; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); - } + if ((item->obj.id == OBJ_ITEM_SILVER_RING) || (item->obj.id == OBJ_ITEM_BOMB) || + (item->obj.id == OBJ_ITEM_LASERS)) { + item->unk_50 = 90.0f; + } - if ((item->obj.id == OBJ_ITEM_SILVER_RING) || (item->obj.id == OBJ_ITEM_BOMB) || - (item->obj.id == OBJ_ITEM_LASERS)) { - item->unk_50 = 90.0f; - } - - if ((item->obj.id >= OBJ_ITEM_GOLD_RING) || (item->obj.id == OBJ_ITEM_1UP)) { - item->unk_50 = 90.0f; - AUDIO_PLAY_SFX(NA_SE_ITEM_APPEAR, gDefaultSfxSource, 4); - item->timer_48 = 1000; - if (item->obj.id == OBJ_ITEM_WING_REPAIR) { - AUDIO_PLAY_SFX(NA_SE_OB_WING, item->sfxSource, 0); + if ((item->obj.id >= OBJ_ITEM_GOLD_RING) || (item->obj.id == OBJ_ITEM_1UP)) { + item->unk_50 = 90.0f; + AUDIO_PLAY_SFX(NA_SE_ITEM_APPEAR, gDefaultSfxSource, 4); + item->timer_48 = 1000; + if (item->obj.id == OBJ_ITEM_WING_REPAIR) { + AUDIO_PLAY_SFX(NA_SE_OB_WING, item->sfxSource, 0); + } } } + break; } } diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 91d91fdc..9d9e031c 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -7012,7 +7012,7 @@ void Play_SpawnVsItem(ObjectId objId, Item* item) { item->obj.pos.y = gScenery360[spawnIndex].obj.pos.y; item->obj.pos.z = gScenery360[spawnIndex].obj.pos.z; item->obj.id = objId; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); } } diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index c0a0197a..e84b306e 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -90,7 +90,7 @@ void Corneria_Granga_SpawnItem(Boss* this, f32 x, f32 y, f32 z, ObjectId itemId) gItems[i].obj.pos.x = x; gItems[i].obj.pos.y = y; gItems[i].obj.pos.z = z; - CALL_CANCELLABLE_EVENT(ItemDropEvent, &gItems[i]){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, &gItems[i]) { Object_SetInfo(&gItems[i].info, gItems[i].obj.id); } break; @@ -596,10 +596,10 @@ void Corneria_CoGranga_1UpCheck(CoGranga* this) { gItems[i].obj.pos.z = gPlayer[0].trueZpos + dest.z; gItems[i].timer_4A = 8; - CALL_CANCELLABLE_EVENT(ItemDropEvent, &gItems[i]){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, &gItems[i]) { Object_SetInfo(&gItems[i].info, gItems[i].obj.id); + Effect_Effect384_Spawn(gItems[i].obj.pos.x, gItems[i].obj.pos.y, gItems[i].obj.pos.z, 5.0f, 0); } - Effect_Effect384_Spawn(gItems[i].obj.pos.x, gItems[i].obj.pos.y, gItems[i].obj.pos.z, 5.0f, 0); break; } } diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index ddda6488..0e342323 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -381,7 +381,7 @@ void Aquas_SpawnItem(Vec3f* pos, ObjectId objId) { item->obj.pos.y = pos->y; item->obj.pos.z = pos->z; item->timer_4A = 2; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); } break; diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index d9e5cc0f..349df18e 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -155,7 +155,7 @@ void Andross_801878A8() { item->obj.pos.z = -gLevelObjects[i].zPos1; item->obj.pos.z += gLevelObjects[i].zPos2; item->obj.pos.y = gLevelObjects[i].yPos; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); } item++; @@ -238,7 +238,7 @@ void Andross_80187C5C(void) { item->obj.pos.z = -gLevelObjects[i].zPos1; item->obj.pos.z += gLevelObjects[i].zPos2; item->obj.pos.y = gLevelObjects[i].yPos; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); } item++; @@ -1637,10 +1637,10 @@ void Andross_Effect396_Update(Effect396* this) { item->obj.pos.y = this->obj.pos.y; item->obj.pos.z = this->obj.pos.z; item->timer_4A = 8; - CALL_CANCELLABLE_EVENT(ItemDropEvent, item){ + item->unk_50 = 90.0f; + CALL_CANCELLABLE_EVENT(ItemDropEvent, item) { Object_SetInfo(&item->info, item->obj.id); } - item->unk_50 = 90.0f; break; } }