mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added additional code to "duplicate obj_dude script data" fix
This commit is contained in:
+4
-3
@@ -599,7 +599,7 @@ ObjCanSeeObj_ShootThru_Fix=0
|
||||
;Set to 1 to fix the broken obj_can_hear_obj script function
|
||||
ObjCanHearObjFix=0
|
||||
|
||||
;Set to 1 to enable the mood argument of start_gdialog script function to be available for talking heads
|
||||
;Set to 1 to enable the mood argument of start_gdialog script function for talking heads
|
||||
;If the argument value is -1, the mood will be determined by the local variable 0 of the script (vanilla behavior)
|
||||
StartGDialogFix=0
|
||||
|
||||
@@ -609,8 +609,9 @@ StartGDialogFix=0
|
||||
;num_attacks - the number of free action points on the first turn only
|
||||
AttackComplexFix=0
|
||||
|
||||
;Set to 1 to enable the create_object_sid script function to run the 'start' script procedure when creating an object
|
||||
;It is recommended to enable this option only if you are developing a new project (TC), otherwise it may affect some existing game scripts
|
||||
;Set to 1 to make the create_object_sid script function run the 'start' procedure of attached script upon object creation
|
||||
;By default, the 'start' procedure of attached script is executed after the current script procedure is finished
|
||||
;Note that enabling this option may cause unexpected results with some existing game scripts
|
||||
CreateObjectSidFix=0
|
||||
|
||||
;Set to 1 to fix the issue with the division operator treating negative integers as unsigned
|
||||
|
||||
@@ -2297,7 +2297,16 @@ skip:
|
||||
}
|
||||
}
|
||||
|
||||
static DWORD dudeScriptID;
|
||||
static void __declspec(naked) map_load_file_hook() {
|
||||
__asm {
|
||||
mov eax, 0x04004650; // dude script ID
|
||||
call fo::funcoffs::scr_remove_;
|
||||
jmp fo::funcoffs::partyMemberRecoverLoad_;
|
||||
}
|
||||
}
|
||||
|
||||
static DWORD dudeScriptID; // usually equal to 0x04004650
|
||||
|
||||
static void __declspec(naked) obj_load_dude_hook0() {
|
||||
__asm {
|
||||
mov eax, ds:[FO_VAR_obj_dude];
|
||||
@@ -2309,8 +2318,10 @@ static void __declspec(naked) obj_load_dude_hook0() {
|
||||
|
||||
static void __declspec(naked) obj_load_dude_hook1() {
|
||||
__asm {
|
||||
mov ebx, dudeScriptID;
|
||||
mov [eax + scriptId], ebx;
|
||||
call fo::funcoffs::scr_clear_dude_script_;
|
||||
mov ebx, ds:[FO_VAR_obj_dude];
|
||||
mov eax, dudeScriptID;
|
||||
mov [ebx + scriptId], eax;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
@@ -3648,6 +3659,7 @@ void BugFixes::init()
|
||||
HookCall(0x499240, PrintAMList_hook);
|
||||
|
||||
// Fix for a duplicate obj_dude script being created when loading a saved game
|
||||
HookCall(0x48306E, map_load_file_hook); // removes the redundant saved dude script data from the scripts block
|
||||
HookCall(0x48D63E, obj_load_dude_hook0);
|
||||
HookCall(0x48D666, obj_load_dude_hook1);
|
||||
BlockCall(0x48D675);
|
||||
|
||||
Reference in New Issue
Block a user