diff --git a/asm/itcm.s b/asm/itcm.s index fd843546..e4020c15 100644 --- a/asm/itcm.s +++ b/asm/itcm.s @@ -7903,9 +7903,9 @@ func_01ffebe0: ; 0x01ffebe0 ldmia sp!, {r3, r4, pc} arm_func_end func_01ffebe0 - .global func_01ffec34 - arm_func_start func_01ffec34 -func_01ffec34: ; 0x01ffec34 + .global _ZN8Cylinder8OverlapsEPS_ + arm_func_start _ZN8Cylinder8OverlapsEPS_ +_ZN8Cylinder8OverlapsEPS_: ; 0x01ffec34 stmdb sp!, {r3, r4, r5, lr} mov r5, r0 mov r4, r1 @@ -7923,7 +7923,7 @@ func_01ffec34: ; 0x01ffec34 movle ip, #1 mov r0, ip ldmia sp!, {r3, r4, r5, pc} - arm_func_end func_01ffec34 + arm_func_end _ZN8Cylinder8OverlapsEPS_ .global func_01ffec78 arm_func_start func_01ffec78 diff --git a/asm/ov00/Actor/Actor.inc b/asm/ov00/Actor/Actor.inc index 5a010763..08f37c61 100644 --- a/asm/ov00/Actor/Actor.inc +++ b/asm/ov00/Actor/Actor.inc @@ -5,7 +5,7 @@ .extern _ZN10MapManager18func_ov00_02084be0Eii .extern _ZN10MapManager18func_ov00_02084c5cEii .extern _ZN10PlayerBase18EquipItem_vfunc_2cEv -.extern _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi +.extern _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi .extern _ZN10PlayerBase12CollidesWithEP8Cylinder .extern _ZN10PlayerBase18func_ov00_020a7c60EP5Vec3pS1_i .extern _ZN12ActorManager12FilterActorsEP15ActorFilterBaseP9ActorList @@ -40,7 +40,7 @@ .extern func_01ff9ec0 .extern Atan2 .extern func_01ffbe34 -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffcec .extern func_01fffd04 .extern func_0202b864 diff --git a/asm/ov00/Actor/Actor.s b/asm/ov00/Actor/Actor.s index 9c322cff..29e01d44 100644 --- a/asm/ov00/Actor/Actor.s +++ b/asm/ov00/Actor/Actor.s @@ -1179,7 +1179,7 @@ _ZN5Actor18CollidesWithShieldEP8Cylinder: ; 0x020c2238 mov r1, r5 ldr r0, [r0] mov r2, #1 - bl _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi + bl _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi cmp r0, #0 addne sp, sp, #0xc movne r0, #1 @@ -1224,7 +1224,7 @@ _020c2308: add r1, sp, #0 ldr r0, [r0] mov r2, #0 - bl _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi + bl _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi cmp r0, #0 addne sp, sp, #0x10 movne r0, #1 @@ -1258,7 +1258,7 @@ _020c2384: add r1, sp, #0 ldr r0, [r0] mov r2, #8 - bl _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi + bl _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi cmp r0, #0 addne sp, sp, #0x10 movne r0, #1 @@ -1558,7 +1558,7 @@ _ZN5Actor12CollidesWithEPKS_: ; 0x020c2744 bl _ZN5Actor9GetHitboxEP8Cylinder add r0, sp, #0x10 add r1, sp, #0 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 movne r4, #1 _020c279c: diff --git a/asm/ov00/Player/PlayerBase.inc b/asm/ov00/Player/PlayerBase.inc index eeb558b8..e2e88d08 100644 --- a/asm/ov00/Player/PlayerBase.inc +++ b/asm/ov00/Player/PlayerBase.inc @@ -1,6 +1,6 @@ #pragma once .extern _ZN11ItemManager18EquipItem_vfunc_2cEi -.extern _ZN11ItemManager18EquipItem_vfunc_3cEP5Vec4pi +.extern _ZN11ItemManager17EquipCollidesWithEP8Cylinderi .extern _ZN13PlayerControl9UpdateAimEv .extern _ZNK11ItemManager16GetEquippedFairyEv .extern _ZNK11ItemManager8GetFairyEi @@ -17,7 +17,7 @@ .extern gActorManager .extern Vec3p_Sub .extern Atan2 -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffcec .extern func_ov00_0207c5d4 .extern _ZN10MapManager18func_ov00_02082af4Ev diff --git a/asm/ov00/Player/PlayerBase.s b/asm/ov00/Player/PlayerBase.s index 9cbae5d6..68bf7819 100644 --- a/asm/ov00/Player/PlayerBase.s +++ b/asm/ov00/Player/PlayerBase.s @@ -145,7 +145,7 @@ _ZN10PlayerBase12CollidesWithEP8Cylinder: ; 0x020a7c1c ldmltia sp!, {r4, pc} add r1, sp, #0 mov r0, r4 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ add sp, sp, #0x10 ldmia sp!, {r4, pc} arm_func_end _ZN10PlayerBase12CollidesWithEP8Cylinder @@ -188,17 +188,17 @@ _ZN10PlayerBase18func_ov00_020a7c60EP5Vec3pS1_i: ; 0x020a7c60 ldmia sp!, {r4, r5, r6, pc} arm_func_end _ZN10PlayerBase18func_ov00_020a7c60EP5Vec3pS1_i - .global _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi - arm_func_start _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi -_ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi: ; 0x020a7ce4 + .global _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi + arm_func_start _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi +_ZN10PlayerBase17EquipCollidesWithEP8Cylinderi: ; 0x020a7ce4 ldr r0, _020a7cf4 ; =gItemManager - ldr ip, _020a7cf8 ; =_ZN11ItemManager18EquipItem_vfunc_3cEP5Vec4pi + ldr ip, _020a7cf8 ; =_ZN11ItemManager17EquipCollidesWithEP8Cylinderi ldr r0, [r0] bx ip .align 2, 0 _020a7cf4: .word gItemManager -_020a7cf8: .word _ZN11ItemManager18EquipItem_vfunc_3cEP5Vec4pi - arm_func_end _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi +_020a7cf8: .word _ZN11ItemManager17EquipCollidesWithEP8Cylinderi + arm_func_end _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi .global _ZN10PlayerBase18EquipItem_vfunc_2cEv arm_func_start _ZN10PlayerBase18EquipItem_vfunc_2cEv diff --git a/asm/ov00/ov00_02086cd0.inc b/asm/ov00/ov00_02086cd0.inc index 3edd19a7..640fdb4d 100644 --- a/asm/ov00/ov00_02086cd0.inc +++ b/asm/ov00/ov00_02086cd0.inc @@ -178,7 +178,7 @@ .extern func_01ffbf5c .extern func_01ffe468 .extern func_01ffebe0 -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fff4c8 .extern func_01fffb4c .extern func_01fffb80 diff --git a/asm/ov00/ov00_02086cd0.s b/asm/ov00/ov00_02086cd0.s index 462b4184..421b84bd 100644 --- a/asm/ov00/ov00_02086cd0.s +++ b/asm/ov00/ov00_02086cd0.s @@ -10028,7 +10028,7 @@ func_ov00_0208f030: ; 0x0208f030 ldr r2, [r5, #8] str r2, [sp, #8] str r3, [sp, #0xc] - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ add sp, sp, #0x28 ldmia sp!, {r3, r4, r5, r6, r7, pc} _0208f0b4: @@ -10129,7 +10129,7 @@ func_ov00_0208f1a0: ; 0x0208f1a0 ldr r2, [r6, #8] str r2, [sp, #8] str r3, [sp, #0xc] - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ add sp, sp, #0x28 ldmia sp!, {r4, r5, r6, r7, r8, pc} _0208f224: @@ -16980,11 +16980,11 @@ _020948c4: .word func_01ffebe0 .global func_ov00_020948c8 arm_func_start func_ov00_020948c8 func_ov00_020948c8: ; 0x020948c8 - ldr ip, _020948d4 ; =func_01ffec34 + ldr ip, _020948d4 ; =_ZN8Cylinder8OverlapsEPS_ add r0, r0, #0x14 bx ip .align 2, 0 -_020948d4: .word func_01ffec34 +_020948d4: .word _ZN8Cylinder8OverlapsEPS_ arm_func_end func_ov00_020948c8 .global func_ov00_020948d8 diff --git a/asm/ov12.inc b/asm/ov12.inc index 5b97a28b..6e29b4ec 100644 --- a/asm/ov12.inc +++ b/asm/ov12.inc @@ -208,7 +208,7 @@ .extern func_01ffbe34 .extern func_01ffbe78 .extern func_01ffbf5c -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffb4c .extern func_01fffbec .extern func_01fffcd8 diff --git a/asm/ov12.s b/asm/ov12.s index d4c6848a..97f0af2e 100644 --- a/asm/ov12.s +++ b/asm/ov12.s @@ -3061,7 +3061,7 @@ _02115420: bl _ZN5Actor9GetHitboxEP8Cylinder add r0, sp, #0x10 add r1, sp, #0 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02115470 mov r0, r4 diff --git a/asm/ov23.inc b/asm/ov23.inc index 7437efb5..733d0ddb 100644 --- a/asm/ov23.inc +++ b/asm/ov23.inc @@ -197,7 +197,7 @@ .extern Atan2 .extern func_01ffbe34 .extern func_01ffbe78 -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffb4c .extern func_01fffbec .extern func_01fffcd8 diff --git a/asm/ov23.s b/asm/ov23.s index 7411a1b5..8f7a58f4 100644 --- a/asm/ov23.s +++ b/asm/ov23.s @@ -6430,7 +6430,7 @@ func_ov23_02172998: ; 0x02172998 bl _ZN5Actor9GetHitboxEP8Cylinder add r0, sp, #0xc add r1, sp, #0x1c - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02172a44 add r0, r4, #0x48 @@ -7050,7 +7050,7 @@ _02173260: ldr r0, [sp, #0xc] add r1, sp, #0x1c add r0, r0, #0x400 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02173330 ldrh r1, [r6, #0x78] @@ -12653,7 +12653,7 @@ _02177c5c: str r1, [sp, #0x58] mov r1, r3 str lr, [sp, #0x50] - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02177df0 ldr r0, [r4, #0x14] diff --git a/asm/ov24.inc b/asm/ov24.inc index daa2431d..0cde5684 100644 --- a/asm/ov24.inc +++ b/asm/ov24.inc @@ -13,7 +13,7 @@ .extern _ZN10MapManager18func_ov00_02084b38Eiii .extern _ZN10MapManager18func_ov00_02084be0Eii .extern _ZN10MapManager18func_ov00_02084d24Ecci -.extern _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi +.extern _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi .extern _ZN12ActorManager13FindActorByIdEj .extern _ZN12ActorManager15FindActorByTypeEP8ActorRefPS_j .extern _ZN12ActorManager18func_ov00_020c3484EP8ActorRefP5Actori @@ -141,7 +141,7 @@ .extern Atan2 .extern func_01ffb7ec .extern func_01ffbf5c -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffcd8 .extern func_01fffcec .extern func_01fffd04 diff --git a/asm/ov24.s b/asm/ov24.s index e65eeaf9..acec5b61 100644 --- a/asm/ov24.s +++ b/asm/ov24.s @@ -3692,7 +3692,7 @@ _021705fc: bne _02170684 add r0, sp, #0 add r1, sp, #0x10 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02170684 mov r0, r5 @@ -9726,7 +9726,7 @@ _021754f4: ldr r0, [r0] add r1, r3, #0x400 mov r2, #0 - bl _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi + bl _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi cmp r0, #0 beq _02175624 bl func_ov24_02170468 diff --git a/asm/ov30.inc b/asm/ov30.inc index 799babff..61e7faaf 100644 --- a/asm/ov30.inc +++ b/asm/ov30.inc @@ -113,7 +113,7 @@ .extern func_01ffbe34 .extern func_01ffbf5c .extern func_01ffe1cc -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffcec .extern func_02002c14 .extern func_0200e8f8 diff --git a/asm/ov30.s b/asm/ov30.s index 7039d00d..17f8c483 100644 --- a/asm/ov30.s +++ b/asm/ov30.s @@ -7348,7 +7348,7 @@ func_ov30_021818b8: ; 0x021818b8 bl _ZN5Actor9GetHitboxEP8Cylinder add r0, sp, #0x44 add r1, sp, #0x34 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02181944 mov r0, r4 @@ -7384,7 +7384,7 @@ _0218195c: bl _ZN5Actor9GetHitboxEP8Cylinder mov r0, r11 mov r1, r8 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _021819cc mov r0, r9 @@ -8298,7 +8298,7 @@ _021825a0: bl _ZN5Actor9GetHitboxEP8Cylinder add r0, sp, #0x24 add r1, r4, #0x860 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02182618 add r0, r4, #0x48 @@ -8414,7 +8414,7 @@ _02182778: bl _ZN5Actor9GetHitboxEP8Cylinder mov r1, r8 add r0, r4, #0x860 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _021827c0 mov r0, r9 diff --git a/asm/ov39.inc b/asm/ov39.inc index 8629ad42..790f3437 100644 --- a/asm/ov39.inc +++ b/asm/ov39.inc @@ -5,7 +5,7 @@ .extern _ZN10MapManager18func_ov00_02084b38Eiii .extern _ZN10MapManager18func_ov00_02084be0Eii .extern _ZN10PlayerBase18EquipItem_vfunc_2cEv -.extern _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi +.extern _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi .extern _ZN10PlayerBase18func_ov00_020a7c60EP5Vec3pS1_i .extern _ZN12ActorManager15FindActorByTypeEP8ActorRefPS_j .extern _ZN12ActorManager8GetActorEP8ActorRef diff --git a/asm/ov39.s b/asm/ov39.s index e69fb5d6..f0a1b44c 100644 --- a/asm/ov39.s +++ b/asm/ov39.s @@ -3513,7 +3513,7 @@ _0217ecdc: add r1, sp, #0 mov r2, #0 str r3, [sp, #0xc] - bl _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi + bl _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi cmp r0, #0 beq _0217edd8 ldr r0, [r4, #0x158] @@ -11551,7 +11551,7 @@ func_ov39_02185c3c: ; 0x02185c3c add r1, sp, #0x28 ldr r0, [r0] mov r2, #1 - bl _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi + bl _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi cmp r0, #0 beq _02185d1c bl func_ov39_02185ea8 diff --git a/asm/ov50.inc b/asm/ov50.inc index 433f0c62..ccc1f336 100644 --- a/asm/ov50.inc +++ b/asm/ov50.inc @@ -102,7 +102,7 @@ .extern Vec3p_Axpy .extern func_01ff9ec0 .extern Atan2 -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffbec .extern func_01fffd04 .extern func_0202b154 diff --git a/asm/ov50.s b/asm/ov50.s index 5984922b..fb77e23e 100644 --- a/asm/ov50.s +++ b/asm/ov50.s @@ -2128,7 +2128,7 @@ func_ov50_021971a4: ; 0x021971a4 bl _ZN5Actor10GetUnk_08cEP8Cylinder add r1, sp, #0 add r0, r4, #4 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 movne r0, #1 moveq r0, #0 diff --git a/asm/ov51.inc b/asm/ov51.inc index 133f4f7e..1dced8a0 100644 --- a/asm/ov51.inc +++ b/asm/ov51.inc @@ -1,5 +1,5 @@ #pragma once -.extern _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi +.extern _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi .extern _ZN12ActorManager8GetActorEP8ActorRef .extern _ZN5Actor10SetUnk_11bEv .extern _ZN5Actor11SetVelocityEP5Vec3p diff --git a/asm/ov51.s b/asm/ov51.s index fbb28c56..a1d6f2fc 100644 --- a/asm/ov51.s +++ b/asm/ov51.s @@ -1209,7 +1209,7 @@ _021963d4: ldr r0, [r4] mov r1, r5 mov r2, #0 - bl _ZN10PlayerBase18EquipItem_vfunc_3cEP8Cylinderi + bl _ZN10PlayerBase17EquipCollidesWithEP8Cylinderi cmp r0, #0 beq _02196450 ldr r0, [r4] diff --git a/asm/ov53.inc b/asm/ov53.inc index 7fcce18a..7d611068 100644 --- a/asm/ov53.inc +++ b/asm/ov53.inc @@ -34,7 +34,7 @@ .extern func_01ff9ec0 .extern func_01ffa9fc .extern func_01ffbe78 -.extern func_01ffec34 +.extern _ZN8Cylinder8OverlapsEPS_ .extern func_01fffcec .extern func_0202b4e4 .extern func_0204f614 diff --git a/asm/ov53.s b/asm/ov53.s index e6c250d4..ba494fbe 100644 --- a/asm/ov53.s +++ b/asm/ov53.s @@ -151,7 +151,7 @@ _02198eb8: bl _ZN5Actor9GetHitboxEP8Cylinder ldr r1, [r5, #4] add r0, sp, #0 - bl func_01ffec34 + bl _ZN8Cylinder8OverlapsEPS_ cmp r0, #0 beq _02198f2c mov r0, r4 diff --git a/include/Item/ItemManager.hpp b/include/Item/ItemManager.hpp index e50fb673..d38e5fb9 100644 --- a/include/Item/ItemManager.hpp +++ b/include/Item/ItemManager.hpp @@ -251,7 +251,7 @@ public: void Sword_vfunc_38(unk32 param1); void Shield_vfunc_38(unk32 param1); void EquipItem_vfunc_38(unk32 param1); - bool EquipItem_vfunc_3c(Vec4p *param1, ItemFlag equipId); + bool EquipCollidesWith(Cylinder *cylinder, ItemFlag equipId); void EquipItem_vfunc_2c(ItemFlag equipId); EquipItem* GetEquipItem(ItemFlag equipId); bool func_ov00_020ad790(unk32 param1); diff --git a/include/Physics/Cylinder.hpp b/include/Physics/Cylinder.hpp index d25eaf22..353469aa 100644 --- a/include/Physics/Cylinder.hpp +++ b/include/Physics/Cylinder.hpp @@ -8,4 +8,6 @@ struct Cylinder { Vec3p pos; q20 size; // height and radius + + bool Overlaps(Cylinder *other); }; diff --git a/include/Player/EquipHammer.hpp b/include/Player/EquipHammer.hpp index 8015d5f4..934b3386 100644 --- a/include/Player/EquipHammer.hpp +++ b/include/Player/EquipHammer.hpp @@ -31,7 +31,7 @@ public: /* 2c */ virtual unk32 vfunc_2c() override; // func_ov59_02198fcc /* 30 */ virtual void vfunc_30() override; // func_ov59_02198e6c /* 38 */ virtual void vfunc_38(unk32 param1) override; // func_0v59_02198fc8 - /* 3c */ virtual bool vfunc_3c(Vec4p *param1) const override; // func_ov14_0213ee10 + /* 3c */ virtual bool GetHitbox(Cylinder *hitbox) const override; // func_ov14_0213ee10 /* 4c */ virtual s32 vfunc_4c() const override; // func_ov14_0213eea8 /* 50 */ }; diff --git a/include/Player/EquipItem.hpp b/include/Player/EquipItem.hpp index c4159185..93fe9e3e 100644 --- a/include/Player/EquipItem.hpp +++ b/include/Player/EquipItem.hpp @@ -4,6 +4,7 @@ #include "global.h" #include "Item/Item.hpp" +#include "Physics/Cylinder.hpp" #include "System/SysNew.hpp" class EquipItem : public SysObject { @@ -33,7 +34,7 @@ public: /* 30 */ virtual void vfunc_30() = 0; /* 34 */ virtual void vfunc_34(unk16 *param1); // func_ov00_020be96c /* 38 */ virtual void vfunc_38(unk32 param1) = 0; - /* 3c */ virtual bool vfunc_3c(Vec4p *param1) const; // func_ov00_020beb90 + /* 3c */ virtual bool GetHitbox(Cylinder *hitbox) const; // func_ov00_020beb90 /* 40 */ virtual unk32 vfunc_40() const; // func_ov00_020be970 /* 44 */ virtual unk32 vfunc_44(unk32 param1) const; // func_ov00_020be978 /* 48 */ virtual unk32 vfunc_48(unk32 param1) const; // func_ov00_020be980 diff --git a/include/Player/EquipShield.hpp b/include/Player/EquipShield.hpp index a66da083..8bf435df 100644 --- a/include/Player/EquipShield.hpp +++ b/include/Player/EquipShield.hpp @@ -30,6 +30,6 @@ public: /* 30 */ virtual void vfunc_30() override; // func_ov00_020c0804 /* 38 */ virtual void vfunc_38(unk32 param1) override; // func_ov00_020c086c - /* 3c */ virtual bool vfunc_3c(Vec4p *param1) const; // func_ov00_020c0a88 + /* 3c */ virtual bool GetHitbox(Cylinder *hitbox) const; // func_ov00_020c0a88 /* 50 */ }; diff --git a/include/Player/EquipSword.hpp b/include/Player/EquipSword.hpp index 57b64443..19bb4779 100644 --- a/include/Player/EquipSword.hpp +++ b/include/Player/EquipSword.hpp @@ -53,6 +53,6 @@ public: /* 2c */ virtual u32 vfunc_2c() override; // func_ov00_020c0674 /* 30 */ virtual void vfunc_30() override; // func_ov00_020bf538 /* 38 */ virtual void vfunc_38(unk32 param1) override; // func_ov00_020bff94 - /* 3c */ virtual bool vfunc_3c(Vec4p *param1) const override; // func_ov00_020c01dc + /* 3c */ virtual bool GetHitbox(Cylinder *hitbox) const override; // func_ov00_020c01dc /* 50 */ }; diff --git a/include/Player/PlayerBase.hpp b/include/Player/PlayerBase.hpp index f618f740..0bb534ff 100644 --- a/include/Player/PlayerBase.hpp +++ b/include/Player/PlayerBase.hpp @@ -55,7 +55,7 @@ public: bool func_ov00_020a7c00(s32 param1); bool CollidesWith(Cylinder *cylinder); bool func_ov00_020a7c60(Vec3p *param1, Vec3p *param2, s32 param3); - void EquipItem_vfunc_3c(Cylinder *cylinder, ItemFlag equipId); + bool EquipCollidesWith(Cylinder *cylinder, ItemFlag equipId); void EquipItem_vfunc_2c(); void SetHealth(s16 health); }; diff --git a/include/lib/math.h b/include/lib/math.h index 04fd2db4..f4c2bafb 100644 --- a/include/lib/math.h +++ b/include/lib/math.h @@ -63,4 +63,3 @@ extern "C" u32 FastDivide(u32 a, u32 b); extern "C" u32 Divide(u32 a, u32 b); extern "C" bool Approach(unk32 *src, unk32 dest, unk32 step); extern "C" bool Approach_thunk(unk32 *src, unk32 dest, unk32 step); -extern "C" bool func_01ffec34(Vec4p *param1, Vec4p *param2); diff --git a/src/00_Core/Item/ItemManager.cpp b/src/00_Core/Item/ItemManager.cpp index df4dbf53..3cc1e185 100644 --- a/src/00_Core/Item/ItemManager.cpp +++ b/src/00_Core/Item/ItemManager.cpp @@ -199,14 +199,14 @@ ARM void ItemManager::EquipItem_vfunc_38(unk32 param1) { (*mEquipItems)[equip]->vfunc_38(param1); } -ARM bool ItemManager::EquipItem_vfunc_3c(Vec4p *param1, ItemFlag equipId) { - Vec4p result; - if ((*mEquipItems)[equipId]->vfunc_3c(&result)) { +ARM bool ItemManager::EquipCollidesWith(Cylinder *hitbox, ItemFlag equipId) { + Cylinder equipHitbox; + if ((*mEquipItems)[equipId]->GetHitbox(&equipHitbox)) { s32 step = (*mEquipItems)[equipId]->vfunc_4c(); if (step > 0) { - Approach_thunk(&result.y, param1->y, step); + Approach_thunk(&equipHitbox.pos.y, hitbox->pos.y, step); } - return func_01ffec34(param1, &result); + return hitbox->Overlaps(&equipHitbox); } return false; }