From ee4e9103f0e7954553a168ade54e54f80fb8147b Mon Sep 17 00:00:00 2001 From: Bigjango13 Date: Thu, 15 Feb 2024 02:50:15 -0500 Subject: [PATCH] Better comment --- mods/src/misc/misc.c | 10 ++++++---- symbols/src/entity/Entity.def | 1 + symbols/src/entity/EntityRenderDispatcher.def | 2 ++ symbols/src/level/container/Container.def | 2 ++ symbols/src/level/container/Inventory.def | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index 9cd0fea..20ba333 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -834,10 +834,12 @@ void init_misc() { overwrite_calls((void *) Player_stopUsingItem, (void *) Player_stopUsingItem_injection); // Fix invalid ItemInHandRenderer texture cache - uchar cmp_r7_patch[] = {0x07, 0x00, 0x57, 0xe1}; // "cmp r7,r7" - patch((void *) 0x4b938, cmp_r7_patch); - uchar moveq_r3_true_patch[] = {0x01, 0x30, 0xa0, 0x03}; // "moveq r3,#0x1" - patch((void *) 0x4b93c, moveq_r3_true_patch); + // This works by forcing MCPI to always use the branch that enables using the + // cache, but then patches that as well to do the opposite + uchar ensure_equal_patch[] = {0x07, 0x00, 0x57, 0xe1}; // "cmp r7,r7" + patch((void *) 0x4b938, ensure_equal_patch); + uchar set_true_patch[] = {0x01, 0x30, 0xa0, 0x03}; // "moveq r3,#0x1" + patch((void *) 0x4b93c, set_true_patch); // Init C++ And Logging _init_misc_cpp(); diff --git a/symbols/src/entity/Entity.def b/symbols/src/entity/Entity.def index e9ca743..ec7a88b 100644 --- a/symbols/src/entity/Entity.def +++ b/symbols/src/entity/Entity.def @@ -32,6 +32,7 @@ property float pitch = 0x44; property float old_yaw = 0x48; property float old_pitch = 0x4c; property AABB hitbox = 0x50; +property float height_offset = 0x68; property int fire_timer = 0xa0; property int renderer_id = 0xa8; property bool on_ground = 0xb2; diff --git a/symbols/src/entity/EntityRenderDispatcher.def b/symbols/src/entity/EntityRenderDispatcher.def index d678fc4..355dc45 100644 --- a/symbols/src/entity/EntityRenderDispatcher.def +++ b/symbols/src/entity/EntityRenderDispatcher.def @@ -1,3 +1,5 @@ constructor () = 0x6096c; method void assign(uchar entity_id, EntityRenderer *renderer) = 0x6094c; +method void render(Entity *entity, float x, float y, float z, float rot, float unknown) = 0x60674; +static-method EntityRenderDispatcher *getInstance() = 0x60e90; diff --git a/symbols/src/level/container/Container.def b/symbols/src/level/container/Container.def index 3b89373..b14460d 100644 --- a/symbols/src/level/container/Container.def +++ b/symbols/src/level/container/Container.def @@ -2,3 +2,5 @@ virtual-method void startOpen() = 0x24; virtual-method void stopOpen() = 0x28; virtual-method ItemInstance *getItem(int slot) = 0x8; virtual-method void setItem(int slot, ItemInstance *item_instance) = 0xc; +virtual-method int getContainerSize() = 0x18; +virtual-method std::vector getSlotCopies() = 0x2c; diff --git a/symbols/src/level/container/Inventory.def b/symbols/src/level/container/Inventory.def index 1108f0b..7a1158c 100644 --- a/symbols/src/level/container/Inventory.def +++ b/symbols/src/level/container/Inventory.def @@ -5,5 +5,6 @@ method void selectSlot(int slot) = 0x8d13c; method ItemInstance *getSelected() = 0x8d134; // It's just FillingContainer_linkSlot with selectedSlot as linked_slot method bool moveToSelectedSlot(int unlinked_slot, bool push_aside) = 0x8d148; +method void setupDefault() = 0x8d164; property int selectedSlot = 0x28;