diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2021-12-27 20:00:25 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-27 20:00:25 -0800 |
| commit | 5b84008265fb7bfd997e8df35301a7d95fd8845d (patch) | |
| tree | df78d3a8bb5ad909bcbfc81943ba4e764a44d120 /src | |
| parent | 4fa53c17a0f43554ca4d6d62b35a467dc71a95d3 (diff) | |
| parent | 1ace8abbc1a06ca7a6761f8b699c84c428c5a527 (diff) | |
Merge pull request #223 from hatal175/PutItemOnSlot
Fix nonmatching PutItemOnSlot
Diffstat (limited to 'src')
| -rw-r--r-- | src/code_0805436C.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/code_0805436C.c b/src/code_0805436C.c index a2352185..62853444 100644 --- a/src/code_0805436C.c +++ b/src/code_0805436C.c @@ -44,13 +44,13 @@ u32 IsItemEquipped(u32 itemID) { return itemSlot; } -NONMATCH("asm/non_matching/PutItemOnSlot.inc", void PutItemOnSlot(u32 itemID)) { - // reg-alloc +void PutItemOnSlot(u32 itemID) { u32 itemSlot; - if (itemID < 0x47) { + register u32 itemID2 asm("r5") = itemID; + if (itemID2 < 0x47) { sub_0807CAA0(0, 1); } - if (itemID - 1 < 0x1f) { + if (itemID2 - 1 < 0x1f) { itemSlot = 2; if (gSave.stats.itemOnA == 0) { itemSlot = 0; @@ -58,7 +58,7 @@ NONMATCH("asm/non_matching/PutItemOnSlot.inc", void PutItemOnSlot(u32 itemID)) { itemSlot = 1; } if (itemSlot == 2) { - u8 temp = gUnk_080FD5B4[itemID].unk; + u8 temp = gUnk_080FD5B4[itemID2].unk; if (temp == gUnk_080FD5B4[gSave.stats.itemOnA].unk) { itemSlot = 0; } else { @@ -70,10 +70,9 @@ NONMATCH("asm/non_matching/PutItemOnSlot.inc", void PutItemOnSlot(u32 itemID)) { return; } } - ForceEquipItem(itemID, itemSlot); + ForceEquipItem(itemID2, itemSlot); } } -END_NONMATCH ASM_FUNC("asm/non_matching/ForceEquipItem.inc", void ForceEquipItem(u32 itemID, u8 itemSlot)) |
