diff --git a/artifacts/config_files/sfall-mods.ini b/artifacts/config_files/sfall-mods.ini index c478a1bf..20c9cb24 100644 --- a/artifacts/config_files/sfall-mods.ini +++ b/artifacts/config_files/sfall-mods.ini @@ -39,7 +39,8 @@ MotionScanner=0 Mode=0 ;PIDList=62,89,97,107,160,161 -;Displays the name of the controlled critter in a notification box above the interface bar. Must be between 5 and 9 +;Choose a notification box to display the name of the controlled critter above the interface bar +;Must be between 5 and (4 + the value of BoxBarCount in ddraw.ini) ;Set to 0 to disable DisplayName=0 diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index a25d482e..99b820cf 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -490,6 +490,9 @@ 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 fix the broken obj_can_hear_obj script function +ObjCanHearObjFix=0 + ;Set to 1 to enable the balanced bullet distribution formula for burst attacks ComputeSprayMod=0 @@ -563,6 +566,7 @@ DontTurnOffSneakIfYouRun=0 CanSellUsedGeiger=1 ;Set to 1 to fix the issue with being able to charge the car by using cells on other scenary/critters +;Set to 0 if another mod you're using has custom vehicles CarChargingFix=1 ;Set to 1 to skip weapon equip/unequip animations when performing various actions diff --git a/artifacts/scripting/hookscripts.txt b/artifacts/scripting/hookscripts.txt index 11532475..e19f13b1 100644 --- a/artifacts/scripting/hookscripts.txt +++ b/artifacts/scripting/hookscripts.txt @@ -401,7 +401,7 @@ This is fired after the default calculation is made. Critter arg1 - Watcher object Obj arg2 - Target object int arg3 - Result of vanilla function: 1 - within perception range, 0 - otherwise -int arg4 - The type of the called hook: 1 - from the script function obj_can_see_obj, 2 - from the script function obj_can_hear_obj (need option CanHearObjFix enabled), 0 for all other cases +int arg4 - Type of hook: 1 - when being called from obj_can_see_obj script function, 2 when being called from obj_can_hear_obj script function (need to set ObjCanHearObjFix=1 in ddraw.ini), 0 for all other cases int ret1 - overrides the returned result of the function: 0 - not in range (can't see), 1 - in range (will see if not blocked), 2 - forced detection (will see regardless, only used in obj_can_see_obj scripting function which is called by every critter in the game) @@ -523,7 +523,7 @@ int ret1 - overrides the animation code (pass -1 if you want to skip the ani ------------------------------------------- -HOOK_EXPLOSIVETIMER (hs_explosivetimer) +HOOK_EXPLOSIVETIMER (hs_explosivetimer.int) Runs after setting the explosive timer. You can override the result. @@ -536,10 +536,10 @@ int ret2 - overrides the result of engine calculation: 0/1 - failure, 2/3 - ------------------------------------------- -HOOK_DESCRIPTIONOBJ (hs_descriptionobj) +HOOK_DESCRIPTIONOBJ (hs_descriptionobj.int) Runs when using the examine action icon to display item description. You can override the description of the item. -An example usage would be to add additional parameters to the description. +An example usage would be to add an additional description to the item based on player's stats/skills. Obj arg1 - the item diff --git a/sfall/Modules/BugFixes.cpp b/sfall/Modules/BugFixes.cpp index d42e1348..50bf79cf 100644 --- a/sfall/Modules/BugFixes.cpp +++ b/sfall/Modules/BugFixes.cpp @@ -1298,7 +1298,7 @@ static void __declspec(naked) op_obj_can_see_obj_hack() { mov ecx, [eax + tile]; // source.tile cmp ecx, -1; jz end; - mov eax, [eax + elevation]; + mov eax, [eax + elevation]; // source.elev mov edi, [edx + elevation]; // target.elev cmp eax, edi; // check source.elev == target.elev retn; @@ -1673,15 +1673,16 @@ void BugFixes::init() dlogr(" Done", DL_INIT); } - // Fix op_obj_can_see_obj_ + // Fix for obj_can_see_obj not checking if source and target objects are on the same elevation before calling + // is_within_perception_ MakeCall(0x456B63, op_obj_can_see_obj_hack); - SafeWrite16(0x456B76, 0x23EB); // jz > jmp (skip unused engine code) + SafeWrite16(0x456B76, 0x23EB); // jmp loc_456B9B (skip unused engine code) - //Fix broken op_obj_can_hear_obj_ (enable a function) - if (GetConfigInt("Misc", "CanHearObjFix", 0) != 0) { - dlog("Applying obj_can_hear_obj opcode fix.", DL_INIT); - SafeWrite8(0x4583D8, 0x3B); // change jz offset - SafeWrite8(0x4583DE, 0x74); // jnz > jz + // Fix broken op_obj_can_hear_obj_ function + if (GetConfigInt("Misc", "ObjCanHearObjFix", 0) != 0) { + dlog("Applying obj_can_hear_obj fix.", DL_INIT); + SafeWrite8(0x4583D8, 0x3B); // jz loc_458414 + SafeWrite8(0x4583DE, 0x74); // jz loc_458414 MakeCall(0x4583E0, op_obj_can_hear_obj_hack); SafeWrite8(0x4583E5, 0x90); dlogr(" Done", DL_INIT);