diff --git a/libreborn/include/libreborn/minecraft.h b/libreborn/include/libreborn/minecraft.h index 18411d2..ad61d24 100644 --- a/libreborn/include/libreborn/minecraft.h +++ b/libreborn/include/libreborn/minecraft.h @@ -110,7 +110,7 @@ static Minecraft_grabMouse_t Minecraft_grabMouse = (Minecraft_grabMouse_t) 0x15d typedef void (*Minecraft_leaveGame_t)(unsigned char *minecraft, bool save_remote_level); static Minecraft_leaveGame_t Minecraft_leaveGame = (Minecraft_leaveGame_t) 0x15ea0; -typedef int (*Minecraft_handleBack_t)(unsigned char *minecraft, bool param_1); +typedef int (*Minecraft_handleBack_t)(unsigned char *minecraft, bool do_nothing); static uint32_t Minecraft_handleBack_vtable_offset = 0x34; static uint32_t Minecraft_screen_width_property_offset = 0x20; // int32_t @@ -206,8 +206,8 @@ static ItemInstance_constructor_extra_t ItemInstance_constructor_item_extra = (I typedef int (*Player_isUsingItem_t)(unsigned char *player); static Player_isUsingItem_t Player_isUsingItem = (Player_isUsingItem_t) 0x8f15c; -typedef void (*Player_drop_t)(unsigned char *player, ItemInstance *item_instance); -static uint32_t Player_drop_vtable_offset = 0x204; +typedef void (*Player_drop_t)(unsigned char *player, ItemInstance *item_instance, bool is_death); +static uint32_t Player_drop_vtable_offset = 0x208; static uint32_t Player_username_property_offset = 0xbf4; // char * static uint32_t Player_inventory_property_offset = 0xbe0; // Inventory * diff --git a/mods/src/input/drop.cpp b/mods/src/input/drop.cpp index 2cc9650..411fb42 100644 --- a/mods/src/input/drop.cpp +++ b/mods/src/input/drop.cpp @@ -73,7 +73,7 @@ void _handle_drop(unsigned char *minecraft) { } // Drop - (*Player_drop)(player, dropped_item); + (*Player_drop)(player, dropped_item, false); } } } diff --git a/mods/src/input/misc.c b/mods/src/input/misc.c index b3c7030..50daf8d 100644 --- a/mods/src/input/misc.c +++ b/mods/src/input/misc.c @@ -29,9 +29,11 @@ void _handle_back(unsigned char *minecraft) { } // Fix OptionsScreen Ignoring The Back Button -static int32_t OptionsScreen_handleBackEvent_injection(unsigned char *screen, __attribute__((unused)) bool param_1) { - unsigned char *minecraft = *(unsigned char **) (screen + Screen_minecraft_property_offset); - (*Minecraft_setScreen)(minecraft, NULL); +static int32_t OptionsScreen_handleBackEvent_injection(unsigned char *screen, bool do_nothing) { + if (!do_nothing) { + unsigned char *minecraft = *(unsigned char **) (screen + Screen_minecraft_property_offset); + (*Minecraft_setScreen)(minecraft, NULL); + } return 1; }