diff --git a/libreborn/include/libreborn/minecraft.h b/libreborn/include/libreborn/minecraft.h index 024d8c1..85e655f 100644 --- a/libreborn/include/libreborn/minecraft.h +++ b/libreborn/include/libreborn/minecraft.h @@ -158,7 +158,9 @@ static uint32_t Gui_selected_item_text_timer_property_offset = 0x9fc; // float // GameMode Constructors +#define CREATOR_MODE_SIZE 0x18 static void *CreatorMode = (void *) 0x1a044; +#define SURVIVAL_MODE_SIZE 0x24 static void *SurvivalMode = (void *) 0x1b7d8; // LevelData diff --git a/mods/src/game_mode/game_mode.c b/mods/src/game_mode/game_mode.c index f8f0460..bd4479b 100644 --- a/mods/src/game_mode/game_mode.c +++ b/mods/src/game_mode/game_mode.c @@ -17,7 +17,7 @@ static void set_is_survival(int new_is_survival) { patch((void *) 0x16efc, inventory_patch); // Use Correct Size For GameMode Object - unsigned char size_patch[4] = {new_is_survival ? 0x24 : 0x18, 0x00, 0xa0, 0xe3}; + unsigned char size_patch[4] = {new_is_survival ? SURVIVAL_MODE_SIZE : CREATOR_MODE_SIZE, 0x00, 0xa0, 0xe3}; patch((void *) 0x16ee4, size_patch); // Replace Default CreatorMode Constructor With CreatorMode Or SurvivalMode Constructor