From f8bd6d380b91e01c360373a27324292dfb9fc438 Mon Sep 17 00:00:00 2001 From: Bigjango13 Date: Tue, 13 Feb 2024 01:18:29 -0500 Subject: [PATCH] Fix invalid ItemInHandRenderer texture cache --- mods/src/misc/misc.c | 6 ++++++ symbols/CMakeLists.txt | 1 + symbols/src/entity/PrimedTnt.def | 2 ++ symbols/src/game/mode/GameMode.def | 4 ++++ symbols/src/tile/DoorTile.def | 5 +++++ 5 files changed, 18 insertions(+) create mode 100644 symbols/src/tile/DoorTile.def diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index f1a8b97efd..9cd0feaa30 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -833,6 +833,12 @@ void init_misc() { overwrite_calls((void *) Player_startUsingItem, (void *) Player_startUsingItem_injection); 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); + // Init C++ And Logging _init_misc_cpp(); _init_misc_logging(); diff --git a/symbols/CMakeLists.txt b/symbols/CMakeLists.txt index 6c0071d736..2cd7abb01d 100644 --- a/symbols/CMakeLists.txt +++ b/symbols/CMakeLists.txt @@ -130,6 +130,7 @@ set(SRC src/app-platform/AppPlatform_linux.def src/app-platform/AppPlatform_readAssetFile_return_value.def src/tile/LeafTile.def + src/tile/DoorTile.def src/tile/Tile.def src/tile/LiquidTile.def src/tile/TallGrass.def diff --git a/symbols/src/entity/PrimedTnt.def b/symbols/src/entity/PrimedTnt.def index 6bff54b346..42e94f32c1 100644 --- a/symbols/src/entity/PrimedTnt.def +++ b/symbols/src/entity/PrimedTnt.def @@ -1,3 +1,5 @@ extends Entity; +vtable 0x10c718; + property int fuse = 0xd0; diff --git a/symbols/src/game/mode/GameMode.def b/symbols/src/game/mode/GameMode.def index 128e258f2e..e16c782c0d 100644 --- a/symbols/src/game/mode/GameMode.def +++ b/symbols/src/game/mode/GameMode.def @@ -1 +1,5 @@ +vtable 0x102e58; +vtable-size 0x60; + +virtual-method void attack(Player *player, Entity *target) = 0x44; virtual-method void releaseUsingItem(Player *player) = 0x5c; diff --git a/symbols/src/tile/DoorTile.def b/symbols/src/tile/DoorTile.def new file mode 100644 index 0000000000..5fa3e63ece --- /dev/null +++ b/symbols/src/tile/DoorTile.def @@ -0,0 +1,5 @@ +extends Tile; + +vtable 0x111220; + +static-method uint getCompositeData(LevelSource *level, int x, int y, int z) = 0xbde40;