diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index f5f09af0..a1fe1722 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -1,22 +1,19 @@ //Recognised modes for set_shader_mode and get_game_mode -#define WORLDMAP (0x1) -#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running -#define DIALOG (0x4) -#define ESCMENU (0x8) -#define SAVEGAME (0x10) -#define LOADGAME (0x20) -#define COMBAT (0x40) -#define OPTIONS (0x80) -#define HELP (0x100) -#define CHARSCREEN (0x200) -#define PIPBOY (0x400) -#define PCOMBAT (0x800) -#define INVENTORY (0x1000) -#define AUTOMAP (0x2000) -#define SKILLDEX (0x4000) -#define INTFACEUSE (0x8000) -#define INTFACELOOT (0x10000) -#define BARTER (0x20000) +#define WORLDMAP (0x1) +#define LOCALMAP (0x2) //No point hooking this: would always be 1 at any point at which scripts are running +#define DIALOG (0x4) +#define ESCMENU (0x8) +#define SAVEGAME (0x10) +#define LOADGAME (0x20) +#define COMBAT (0x40) +#define OPTIONS (0x80) +#define HELP (0x100) +#define CHARSCREEN (0x200) +#define PIPBOY (0x400) +#define PCOMBAT (0x800) +#define INVENTORY (0x1000) +#define AUTOMAP (0x2000) +#define SKILLDEX (0x4000) //Valid arguments to register_hook #define HOOK_TOHIT (0) diff --git a/sfall/FalloutEngine.cpp b/sfall/FalloutEngine.cpp index d823f2d8..d2c45072 100644 --- a/sfall/FalloutEngine.cpp +++ b/sfall/FalloutEngine.cpp @@ -246,7 +246,6 @@ const DWORD art_ptr_unlock_ = 0x419260; const DWORD attack_crit_success_ = 0x423EB4; const DWORD automap_ = 0x41B8BC; const DWORD barter_compute_value_ = 0x474B2C; -const DWORD barter_inventory_ = 0x4757F0; const DWORD buf_to_buf_ = 0x4D36D4; const DWORD check_death_ = 0x410814; const DWORD Check4Keys_ = 0x43F73C; @@ -424,7 +423,6 @@ const DWORD loadColorTable_ = 0x4C78E4; const DWORD LoadGame_ = 0x47C640; const DWORD loadProgram_ = 0x4A3B74; const DWORD LoadSlot_ = 0x47DC68; -const DWORD loot_container_ = 0x473904; const DWORD main_game_loop_ = 0x480E48; const DWORD main_menu_hide_ = 0x481A00; const DWORD main_menu_loop_ = 0x481AEC; @@ -580,7 +578,6 @@ const DWORD trait_get_ = 0x4B3B54; const DWORD trait_init_ = 0x4B39F0; const DWORD trait_level_ = 0x4B3BC8; const DWORD trait_set_ = 0x4B3B48; -const DWORD use_inventory_on_ = 0x4717E4; const DWORD _word_wrap_ = 0x4BC6F0; const DWORD win_add_ = 0x4D6238; const DWORD win_delete_ = 0x4D6468; diff --git a/sfall/FalloutEngine.h b/sfall/FalloutEngine.h index 838b518f..b00652e3 100644 --- a/sfall/FalloutEngine.h +++ b/sfall/FalloutEngine.h @@ -420,7 +420,6 @@ extern const DWORD art_ptr_unlock_; extern const DWORD attack_crit_success_; extern const DWORD automap_; extern const DWORD barter_compute_value_; -extern const DWORD barter_inventory_; extern const DWORD buf_to_buf_; extern const DWORD check_death_; extern const DWORD Check4Keys_; @@ -597,7 +596,6 @@ extern const DWORD loadColorTable_; extern const DWORD LoadGame_; extern const DWORD loadProgram_; // loads script from scripts/ folder by file name and returns pointer to it: char* - file name (w/o extension) extern const DWORD LoadSlot_; -extern const DWORD loot_container_; extern const DWORD main_game_loop_; extern const DWORD main_menu_hide_; extern const DWORD main_menu_loop_; @@ -756,7 +754,6 @@ extern const DWORD trait_get_; extern const DWORD trait_init_; extern const DWORD trait_level_; extern const DWORD trait_set_; -extern const DWORD use_inventory_on_; extern const DWORD _word_wrap_; extern const DWORD win_add_; extern const DWORD win_delete_; diff --git a/sfall/LoadGameHook.cpp b/sfall/LoadGameHook.cpp index 35cc5acd..04c542c7 100644 --- a/sfall/LoadGameHook.cpp +++ b/sfall/LoadGameHook.cpp @@ -419,34 +419,6 @@ static void __declspec(naked) HandleInventoryHook() { } } -static void __declspec(naked) UseInventoryOnHook() { - __asm { - or InLoop, INTFACEUSE; - call use_inventory_on_; - and InLoop, (-1 ^ INTFACEUSE); - retn; - } -} - -static void __declspec(naked) LootContainerHook() { - __asm { - or InLoop, INTFACELOOT; - call loot_container_; - and InLoop, (-1 ^ INTFACELOOT); - retn; - } -} - -static void __declspec(naked) BarterInventoryHook() { - __asm { - or InLoop, BARTER; - push [ESP + 4]; - call barter_inventory_; - and InLoop, (-1 ^ BARTER); - retn 4; - } -} - static void __declspec(naked) AutomapHook() { __asm { or InLoop, AUTOMAP; @@ -518,11 +490,6 @@ void LoadGameHookInit() { HookCall(0x4434AC, SkilldexHook); HookCall(0x44C7BD, SkilldexHook); HookCall(0x443357, HandleInventoryHook); - HookCall(0x44C6FB, UseInventoryOnHook); - HookCall(0x4746EC, LootContainerHook); - HookCall(0x4A4369, LootContainerHook); - HookCall(0x4A4565, LootContainerHook); - HookCall(0x4466C7, BarterInventoryHook); HookCall(0x44396D, AutomapHook); HookCall(0x479519, AutomapHook); } diff --git a/sfall/LoadGameHook.h b/sfall/LoadGameHook.h index 64f04a3c..03242b47 100644 --- a/sfall/LoadGameHook.h +++ b/sfall/LoadGameHook.h @@ -24,24 +24,21 @@ bool IsMapLoaded(); DWORD InWorldMap(); DWORD InCombat(); -#define WORLDMAP (1<<0) // 0x1 -#define LOCALMAP (1<<1) // 0x2 No point hooking this: would always be 1 at any point at which scripts are running -#define DIALOG (1<<2) // 0x4 -#define ESCMENU (1<<3) // 0x8 -#define SAVEGAME (1<<4) // 0x10 -#define LOADGAME (1<<5) // 0x20 -#define COMBAT (1<<6) // 0x40 -#define OPTIONS (1<<7) // 0x80 -#define HELP (1<<8) // 0x100 -#define CHARSCREEN (1<<9) // 0x200 -#define PIPBOY (1<<10) // 0x400 -#define PCOMBAT (1<<11) // 0x800 -#define INVENTORY (1<<12) // 0x1000 -#define AUTOMAP (1<<13) // 0x2000 -#define SKILLDEX (1<<14) // 0x4000 -#define INTFACEUSE (1<<15) // 0x8000 -#define INTFACELOOT (1<<16) // 0x10000 -#define BARTER (1<<17) // 0x20000 +#define WORLDMAP (1<<0) // 0x1 +#define LOCALMAP (1<<1) // 0x2 No point hooking this: would always be 1 at any point at which scripts are running +#define DIALOG (1<<2) // 0x4 +#define ESCMENU (1<<3) // 0x8 +#define SAVEGAME (1<<4) // 0x10 +#define LOADGAME (1<<5) // 0x20 +#define COMBAT (1<<6) // 0x40 +#define OPTIONS (1<<7) // 0x80 +#define HELP (1<<8) // 0x100 +#define CHARSCREEN (1<<9) // 0x200 +#define PIPBOY (1<<10) // 0x400 +#define PCOMBAT (1<<11) // 0x800 +#define INVENTORY (1<<12) // 0x1000 +#define AUTOMAP (1<<13) // 0x2000 +#define SKILLDEX (1<<14) // 0x4000 #define RESERVED (1<<31) DWORD GetCurrentLoops();