mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed a bug when using HOOK_ITEMDAMAGE and calling item_w_damage_ engine function at the same time. It would result in player self-damaging when attacking targets.
Set DataLoadOrderPatch to be enabled by default, for preventing partial of a game crash issue due to unusual game folder setup. #136
This commit is contained in:
+2
-2
@@ -184,10 +184,10 @@ WorldMapSlots=0
|
||||
;PatchFile=patch%03d.dat
|
||||
;MultiPatches=0
|
||||
|
||||
;Set to 1 to enable the modified data load order for the engine to find game data
|
||||
;Set to 1 to use 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
|
||||
DataLoadOrderPatch=1
|
||||
|
||||
;To change the default and starting player models, uncomment the next four lines.
|
||||
;The default models can also be changed ingame via script
|
||||
|
||||
@@ -231,13 +231,13 @@ static void __declspec(naked) ItemDamageHook() {
|
||||
mov args[0], eax; //min
|
||||
mov args[4], edx; //max
|
||||
mov args[8], edi; //weapon
|
||||
mov args[12], ecx; //critter
|
||||
mov args[16], esi; //type
|
||||
mov args[20], ebp; //non-zero for weapon melee attack
|
||||
test edi, edi;
|
||||
jnz skip;
|
||||
add args[16], 8;
|
||||
mov args[12], ecx; //source
|
||||
test edi, edi; //has a weapon in hand?
|
||||
jnz skip; //yes
|
||||
add esi, 8; //edit hit_mode
|
||||
skip:
|
||||
mov args[16], esi; //hit_mode
|
||||
mov args[20], ebp; //non-zero for weapon melee attack
|
||||
pushad;
|
||||
push HOOK_ITEMDAMAGE;
|
||||
call RunHookScript;
|
||||
|
||||
@@ -93,7 +93,7 @@ skip:
|
||||
}
|
||||
|
||||
void LoadOrder::init() {
|
||||
if (GetConfigInt("Misc", "DataLoadOrderPatch", 0)) {
|
||||
if (GetConfigInt("Misc", "DataLoadOrderPatch", 1)) {
|
||||
dlog("Applying data load order patch.", DL_INIT);
|
||||
MakeCall(0x444259, game_init_databases_hack1);
|
||||
MakeCall(0x4442F1, game_init_databases_hack2);
|
||||
|
||||
Reference in New Issue
Block a user