diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index b7fb545f..3dfc7f06 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -1,5 +1,5 @@ ;sfall configuration settings -;v3.8.4 +;v3.8.5 [Main] ;Change to 1 if you want to use command line args to tell sfall to use another ini file. diff --git a/artifacts/scripting/headers/define_extra.h b/artifacts/scripting/headers/define_extra.h index 8a927ee1..c8d398a2 100644 --- a/artifacts/scripting/headers/define_extra.h +++ b/artifacts/scripting/headers/define_extra.h @@ -83,6 +83,7 @@ #define PROTO_IT_SIZE (112) #define PROTO_IT_WEIGHT (116) #define PROTO_IT_COST (120) +#define PROTO_IT_INV_FID (124) // weapons #define PROTO_WP_ANIM (36) diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index 062afe42..a1fe1722 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -189,10 +189,10 @@ #define party_member_list_all party_member_list(1) -#define spatial_radius(obj) sfall_func1("spatial_radius", obj) #define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type) -#define intface_redraw sfall_func0("intface_redraw") -#define intface_hide sfall_func0("intface_hide") -#define intface_show sfall_func0("intface_show") -#define intface_is_hidden sfall_func0("intface_is_hidden") #define exec_map_update_scripts sfall_func0("exec_map_update_scripts") +#define intface_hide sfall_func0("intface_hide") +#define intface_is_hidden sfall_func0("intface_is_hidden") +#define intface_redraw sfall_func0("intface_redraw") +#define intface_show sfall_func0("intface_show") +#define spatial_radius(obj) sfall_func1("spatial_radius", obj) diff --git a/artifacts/scripting/hookscripts.txt b/artifacts/scripting/hookscripts.txt index c2bd70fe..2599b1e6 100644 --- a/artifacts/scripting/hookscripts.txt +++ b/artifacts/scripting/hookscripts.txt @@ -13,15 +13,15 @@ Example setup for a hook-script based mod: procedure tohit_hook_handler begin - display_msg("Modifying hit_hook " + get_sfall_arg); - set_hit_chance_max(100); - set_sfall_return(100); + display_msg("Modifying hit_hook " + get_sfall_arg); + set_hit_chance_max(100); + set_sfall_return(100); end procedure start begin - if game_loaded then begin - register_hook_proc(HOOK_TOHIT, tohit_hook_handler); - end + if game_loaded then begin + register_hook_proc(HOOK_TOHIT, tohit_hook_handler); + end end diff --git a/sfall/FalloutEngine.cpp b/sfall/FalloutEngine.cpp index 6499b33b..dbf38537 100644 --- a/sfall/FalloutEngine.cpp +++ b/sfall/FalloutEngine.cpp @@ -318,6 +318,7 @@ const DWORD elapsed_time_ = 0x4C93E0; const DWORD elevator_end_ = 0x43F6D0; const DWORD elevator_start_ = 0x43F324; const DWORD endgame_slideshow_ = 0x43F788; +const DWORD EndLoad_ = 0x47F4C8; const DWORD exec_script_proc_ = 0x4A4810; const DWORD executeProcedure_ = 0x46DD2C; const DWORD findCurrentProc_ = 0x467160; diff --git a/sfall/FalloutEngine.h b/sfall/FalloutEngine.h index 7c8eaad8..da887764 100644 --- a/sfall/FalloutEngine.h +++ b/sfall/FalloutEngine.h @@ -492,6 +492,7 @@ extern const DWORD elapsed_time_; extern const DWORD elevator_end_; extern const DWORD elevator_start_; extern const DWORD endgame_slideshow_; +extern const DWORD EndLoad_; extern const DWORD exec_script_proc_; // unsigned int aScriptID, int aProcId extern const DWORD executeProcedure_; // - programPtr, - procNumber extern const DWORD fadeSystemPalette_; diff --git a/sfall/LoadGameHook.cpp b/sfall/LoadGameHook.cpp index 7fefb8de..cf9841ef 100644 --- a/sfall/LoadGameHook.cpp +++ b/sfall/LoadGameHook.cpp @@ -220,12 +220,6 @@ static void __declspec(naked) LoadGame() { or InLoop, LOADGAME; call LoadGame_; and InLoop, (-1^LOADGAME); - cmp eax, 1; - jne end; - call LoadGame2_After; - mov eax, 1; -end: - pop edx; pop ecx; pop ebx; @@ -233,6 +227,16 @@ end: } } +static void __declspec(naked) EndLoadHook() { + __asm { + call EndLoad_; + pushad; + call LoadGame2_After; + popad; + retn; + } +} + static void NewGame2() { ResetState(0); @@ -460,6 +464,7 @@ void LoadGameHookInit() { HookCall(0x443B89, LoadGame); HookCall(0x480B77, LoadGame); HookCall(0x48FD35, LoadGame); + SafeWrite32(0x5194C0, (DWORD)&EndLoadHook); HookCall(0x443AAC, SaveGame); HookCall(0x443B1C, SaveGame); HookCall(0x48FCFF, SaveGame); diff --git a/sfall/version.h b/sfall/version.h index 5fd36e4f..da00b949 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -22,12 +22,12 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 8 -#define VERSION_BUILD 4 +#define VERSION_BUILD 5 #define VERSION_REV 0 #ifdef WIN2K -#define VERSION_STRING "3.8.4 win2k" +#define VERSION_STRING "3.8.5 win2k" #else -#define VERSION_STRING "3.8.4" +#define VERSION_STRING "3.8.5" #endif #define CHECK_VAL (4)