diff --git a/asm/include/ov09.inc b/asm/include/ov09.inc index 61490183..f7ebf067 100644 --- a/asm/include/ov09.inc +++ b/asm/include/ov09.inc @@ -895,7 +895,7 @@ .extern _ZNK11ItemManager19GetEquippedShipPartEj .extern _ZN11ItemManager13EquipShipPartEjj .extern _ZNK11ItemManager16GetShipPartCountEjj -.extern _ZN11ItemManager16SetShipPartCountEjjj +.extern _ZN11ItemManager16SetShipPartCountEjjc .extern gItemManager .extern _ZNK11ItemManager19GetEquippedShipPartEj .extern _ZN11ItemManager13EquipShipPartEjj @@ -927,16 +927,16 @@ .extern gItemManager .extern _ZN11ItemManager10GiveRupeesEjj .extern _ZNK11ItemManager16GetShipPartCountEjj -.extern _ZN11ItemManager16SetShipPartCountEjjj +.extern _ZN11ItemManager16SetShipPartCountEjjc .extern gItemManager .extern _ZN11ItemManager10GiveRupeesEjj .extern _ZNK11ItemManager16GetTreasureCountEj .extern _ZN11ItemManager16SetTreasureCountEjj .extern gItemManager .extern _ZNK11ItemManager16GetShipPartCountEjj -.extern _ZN11ItemManager16SetShipPartCountEjjj +.extern _ZN11ItemManager16SetShipPartCountEjjc .extern _ZNK11ItemManager16GetShipPartCountEjj -.extern _ZN11ItemManager16SetShipPartCountEjjj +.extern _ZN11ItemManager16SetShipPartCountEjjc .extern gItemManager .extern gOverlayManager .extern data_027e1058 diff --git a/asm/include/ov45.inc b/asm/include/ov45.inc index 956f58a9..3eb0ef62 100644 --- a/asm/include/ov45.inc +++ b/asm/include/ov45.inc @@ -521,7 +521,7 @@ .extern func_ov09_02118028 .extern func_ov09_02118028 .extern _ZNK11ItemManager16GetShipPartCountEjj -.extern _ZN11ItemManager16SetShipPartCountEjjj +.extern _ZN11ItemManager16SetShipPartCountEjjc .extern data_ov09_0211f52c .extern gItemManager .extern func_ov09_02113f40 diff --git a/asm/ov00/ItemManager/ItemManager.s b/asm/ov00/ItemManager/ItemManager.s index 71bd4462..3b2d0902 100644 --- a/asm/ov00/ItemManager/ItemManager.s +++ b/asm/ov00/ItemManager/ItemManager.s @@ -3,24 +3,6 @@ .text - .global _ZN11ItemManager16SetShipPartCountEjjj - thumb_func_start _ZN11ItemManager16SetShipPartCountEjjj -_ZN11ItemManager16SetShipPartCountEjjj: ; 0x020ad900 - push {r3, r4} - cmp r3, #0x63 - ble _020ad908 - mov r3, #0x63 -_020ad908: - lsl r4, r1, #3 - add r1, r1, r4 - add r0, r0, r1 - add r0, r0, r2 - add r0, #0x48 - strb r3, [r0] - pop {r3, r4} - bx lr - thumb_func_end _ZN11ItemManager16SetShipPartCountEjjj - .global _ZNK11ItemManager16GetTreasureCountEj thumb_func_start _ZNK11ItemManager16GetTreasureCountEj _ZNK11ItemManager16GetTreasureCountEj: ; 0x020ad918 diff --git a/asm/ov09.s b/asm/ov09.s index d7e84875..3961d617 100644 --- a/asm/ov09.s +++ b/asm/ov09.s @@ -16982,7 +16982,7 @@ _0211c6d8: add r1, r5, #0 mov r2, #0 mov r3, #1 - bl _ZN11ItemManager16SetShipPartCountEjjj + bl _ZN11ItemManager16SetShipPartCountEjjc _0211c6f2: add r5, r5, #1 cmp r5, #8 @@ -17428,7 +17428,7 @@ func_ov09_0211c9a8: ; 0x0211c9a8 add r1, r5, #0 add r2, r4, #0 asr r3, r3, #0x18 - bl _ZN11ItemManager16SetShipPartCountEjjj + bl _ZN11ItemManager16SetShipPartCountEjjc pop {r4, r5, r6, pc} nop thumb_func_end func_ov09_0211c9a8 @@ -17496,7 +17496,7 @@ _0211ca3c: ldr r0, [r0] add r2, r4, #0 mov r3, #1 - bl _ZN11ItemManager16SetShipPartCountEjjj + bl _ZN11ItemManager16SetShipPartCountEjjc b _0211ca7c _0211ca5c: ldr r0, _0211caa8 ; =gItemManager @@ -17512,7 +17512,7 @@ _0211ca5c: add r1, r5, #0 add r2, r4, #0 asr r3, r3, #0x18 - bl _ZN11ItemManager16SetShipPartCountEjjj + bl _ZN11ItemManager16SetShipPartCountEjjc _0211ca7c: ldr r0, _0211caac ; =data_ov09_0211f294 str r5, [r0] diff --git a/asm/ov45.s b/asm/ov45.s index f659e36d..816379ee 100644 --- a/asm/ov45.s +++ b/asm/ov45.s @@ -6182,7 +6182,7 @@ func_ov45_0218e010: ; 0x0218e010 sub r3, r3, #1 mov r3, r3, lsl #0x18 mov r3, r3, asr #0x18 - blx _ZN11ItemManager16SetShipPartCountEjjj + blx _ZN11ItemManager16SetShipPartCountEjjc ldmia sp!, {r4, r5, r6, pc} .align 2, 0 arm_func_end func_ov45_0218e010 diff --git a/src/ItemManager.cpp b/src/ItemManager.cpp index abca58d5..2d37ca5d 100644 --- a/src/ItemManager.cpp +++ b/src/ItemManager.cpp @@ -283,3 +283,8 @@ THUMB void ItemManager::EquipShipPart(ShipPart part, ShipType type) { THUMB s8 ItemManager::GetShipPartCount(ShipPart part, ShipType type) const { return this->mShipParts[part][type]; } + +THUMB void ItemManager::SetShipPartCount(ShipPart part, ShipType type, s8 count) { + if (count > 99) count = 99; + this->mShipParts[part][type] = count; +}