Browse Source

Remove More Magic Numbers

pull/9/head
TheBrokenRail 10 months ago
parent
commit
05ec8f6059
  1. 2
      libreborn/include/libreborn/minecraft.h
  2. 2
      mods/src/game_mode/game_mode.c

2
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

2
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

Loading…
Cancel
Save