summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiritoDv <kiritodev01@gmail.com>2024-12-28 19:25:23 -0600
committerKiritoDv <kiritodev01@gmail.com>2024-12-28 19:25:23 -0600
commit4813a7377ea813cf18a06980497bb904374227ff (patch)
treec19c6025dd676462d7372614555f34127bae60ad
parent679057f36498fafc3bf28afec8bb7114293f08bb (diff)
Fixed ItemDropEvent logic
-rw-r--r--src/engine/fox_demo.c2
-rw-r--r--src/engine/fox_enmy.c32
-rw-r--r--src/engine/fox_play.c2
-rw-r--r--src/overlays/ovl_i1/fox_co.c6
-rw-r--r--src/overlays/ovl_i3/fox_aq.c2
-rw-r--r--src/overlays/ovl_i6/fox_andross.c8
6 files changed, 26 insertions, 26 deletions
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 a37d58ee..7e2c4096 100644
--- a/src/engine/fox_play.c
+++ b/src/engine/fox_play.c
@@ -7011,7 +7011,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 f04a28f4..e8a8137a 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;
}
}