diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index e5e9812f..59e79a11 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -1,5 +1,5 @@ ;sfall configuration settings -;v3.7.3 +;v3.7.4 [Main] ;Change to 1 if you want to use command line args to tell sfall to use another ini file. @@ -201,10 +201,15 @@ WorldMapSlots=0 ;To use a patch file other than patch000.dat, uncomment the next line and add your new file name ;If you want to check for multiple patch files, you can include a %d in the file name (sprintf syntax) ;By default, only the first patch file found will be used. -;If you want to load multiple patch files at once, uncomment the MultiPatches line and set it to 1 +;If you want to load multiple patch files (up to 1000) at once, uncomment the MultiPatches line and set it to 1 ;PatchFile=patch%03d.dat ;MultiPatches=0 +;Set to 1 to enable the modified data load order for the engine to find game data +;Original: patchXXX.dat > critter_patches > critter_dat > f2_res_patches > f2_res_dat > master_patches > master_dat +;Modified: master_patches > critter_patches > patchXXX.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat +DataLoadOrderPatch=0 + ;To change the default and starting player models, uncomment the next four lines. ;The default models can also be changed ingame via script ;MaleStartModel=hmwarr @@ -477,7 +482,7 @@ QuickPocketsApCostReduction=2 ;Set to 1 to allow objects seeing through other objects with their ShootThru flag set ObjCanSeeObj_ShootThru_Fix=0 -;Set to 1 to use the balanced bullet distribution formula for burst attacks +;Set to 1 to enable the balanced bullet distribution formula for burst attacks ComputeSprayMod=1 ;These options modify the bullet distribution of burst attacks if ComputeSprayMod is 1 diff --git a/sfall/FalloutEngine.cpp b/sfall/FalloutEngine.cpp index f78e1048..1a54ee05 100644 --- a/sfall/FalloutEngine.cpp +++ b/sfall/FalloutEngine.cpp @@ -375,6 +375,7 @@ const DWORD stat_pc_add_experience_ = 0x4AFAA8; const DWORD stat_pc_get_ = 0x4AF8FC; const DWORD stat_pc_set_ = 0x4AF910; const DWORD stat_set_bonus_ = 0x4AF63C; +const DWORD stricmp_ = 0x4DECE6; const DWORD strncpy_ = 0x4F014F; const DWORD switch_hand_ = 0x4714E0; const DWORD talk_to_translucent_trans_buf_to_buf_ = 0x44AC68; @@ -419,6 +420,7 @@ const DWORD xfread_ = 0x4DF44C; const DWORD xfseek_ = 0x4DF5D8; const DWORD xftell_ = 0x4DF690; const DWORD xfwrite_ = 0x4DF4E8; +const DWORD xremovepath_ = 0x4DFAB4; const DWORD xrewind_ = 0x4DF6E4; const DWORD xungetc_ = 0x4DF3F4; const DWORD xvfprintf_ = 0x4DF1AC; diff --git a/sfall/FalloutEngine.h b/sfall/FalloutEngine.h index b59a9707..20dd139c 100644 --- a/sfall/FalloutEngine.h +++ b/sfall/FalloutEngine.h @@ -46,6 +46,7 @@ #define _combat_turn_running 0x51093C #define _combatNumTurns 0x510940 #define _crit_succ_eff 0x510978 +#define _critter_db_handle 0x58E94C #define _critterClearObj 0x518438 #define _crnt_func 0x664508 #define _curr_font_num 0x51E3B0 @@ -113,6 +114,7 @@ #define _main_window 0x5194F0 #define _map_elevation 0x519578 #define _map_global_vars 0x51956C +#define _master_db_handle 0x58E948 #define _max 0x56FB50 #define _Meet_Frank_Horrigan 0x672E04 #define _mouse_hotx 0x6AC7D0 @@ -539,6 +541,7 @@ extern const DWORD stat_pc_add_experience_; extern const DWORD stat_pc_get_; extern const DWORD stat_pc_set_; extern const DWORD stat_set_bonus_; +extern const DWORD stricmp_; extern const DWORD strncpy_; extern const DWORD switch_hand_; extern const DWORD talk_to_translucent_trans_buf_to_buf_; @@ -583,6 +586,7 @@ extern const DWORD xfread_; extern const DWORD xfseek_; extern const DWORD xftell_; extern const DWORD xfwrite_; +extern const DWORD xremovepath_; extern const DWORD xrewind_; extern const DWORD xungetc_; extern const DWORD xvfprintf_; diff --git a/sfall/ddraw2.cpp b/sfall/ddraw2.cpp index e5cacfa5..7506fb69 100644 --- a/sfall/ddraw2.cpp +++ b/sfall/ddraw2.cpp @@ -170,9 +170,7 @@ void _stdcall SetShaderMode(DWORD d, DWORD mode) { } int _stdcall LoadShader(const char* path) { - if(GraphicsMode < 4) return -1; - if(strstr(path, "..")) return -1; - if(strstr(path, ":")) return -1; + if ((GraphicsMode < 4) || (strstr(path, "..")) || (strstr(path, ":"))) return -1; char buf[MAX_PATH]; sprintf(buf, "%s\\shaders\\%s", *(char**)_patches, path); for(DWORD d=0;d_paths + mov edx, ecx +skip: + mov [eax+0xC], edx // master_patches.next + mov ds:[_paths], eax + retn + } +} + static char KarmaGainMsg[128]; static char KarmaLossMsg[128]; static void _stdcall SetKarma(int value) { @@ -1215,6 +1283,15 @@ static void DllMain2() { dlogr(" Done", DL_INIT); } + if (GetPrivateProfileIntA("Misc", "DataLoadOrderPatch", 0, ini)) { + dlog("Applying data load order patch.", DL_INIT); + MakeCall(0x444259, &game_init_databases_hack1, false); + MakeCall(0x4442F1, &game_init_databases_hack2, false); + HookCall(0x44436D, &game_init_databases_hook); + SafeWrite8(0x4DFAEC, 0x1D); // error correction + dlogr(" Done", DL_INIT); + } + if(GetPrivateProfileInt("Misc", "DisplayKarmaChanges", 0, ini)) { dlog("Applying display karma changes patch.", DL_INIT); GetPrivateProfileString("sfall", "KarmaGain", "You gained %d karma.", KarmaGainMsg, 128, translationIni); diff --git a/sfall/version.h b/sfall/version.h index c60eab8c..dd8026df 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -22,12 +22,12 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 7 -#define VERSION_BUILD 3 +#define VERSION_BUILD 4 #define VERSION_REV 0 #ifdef WIN2K -#define VERSION_STRING "3.7.3 win2k" +#define VERSION_STRING "3.7.4 win2k" #else -#define VERSION_STRING "3.7.3" +#define VERSION_STRING "3.7.4" #endif #define CHECK_VAL (4)