diff --git a/artifacts/scripting/hookscripts.md b/artifacts/scripting/hookscripts.md
index 2e9a284b..3e9129ef 100644
--- a/artifacts/scripting/hookscripts.md
+++ b/artifacts/scripting/hookscripts.md
@@ -96,8 +96,8 @@ Critter arg1 - The attacker
Critter arg2 - The target of the attack
int arg3 - The targeted bodypart
int arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position)
-int arg5 - Attack Type (one of ATKTYPE_*)
-int arg6 - Ranged flag. 1 means the hit chance is calculated by taking into account the bonuses/penalties of the distance to the target
+int arg5 - Attack Type (see ATKTYPE_* constants)
+int arg6 - Ranged flag. 1 if the hit chance calculation takes into account the distance to the target. This does not mean the attack is a ranged attack
int arg7 - The raw hit chance before applying the cap
int ret0 - the new hit chance
diff --git a/artifacts/scripting/sfall function notes.md b/artifacts/scripting/sfall function notes.md
index 63c7b05b..b18cca2a 100644
--- a/artifacts/scripting/sfall function notes.md
+++ b/artifacts/scripting/sfall function notes.md
@@ -661,7 +661,7 @@ sfall_funcX metarule functions
----
#### inventory_redraw
-`void sfall_func0("inventory_redraw")`
+`void sfall_func0("inventory_redraw")`\
`void sfall_func1("inventory_redraw", int invSide)`
- Redraws inventory list in the inventory/use inventory item on/loot/barter screens
- `invSide` specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument)
@@ -673,7 +673,7 @@ sfall_funcX metarule functions
----
#### create_win
-`void sfall_func5("create_win", string winName, int x, int y, int width, int height)`
+`void sfall_func5("create_win", string winName, int x, int y, int width, int height)`\
`void sfall_func6("create_win", string winName, int x, int y, int width, int height, int flags)`
- Works just like vanilla `CreateWin` function, but creates a window with `MoveOnTop` flag if the flags argument is not specified, and allows to set additional flags for the created window
- `MoveOnTop` flag allows the created window to be placed on top of the game interface
diff --git a/sfall/Modules/MiscPatches.cpp b/sfall/Modules/MiscPatches.cpp
index 5c1ec417..e9f61677 100644
--- a/sfall/Modules/MiscPatches.cpp
+++ b/sfall/Modules/MiscPatches.cpp
@@ -855,6 +855,17 @@ static void EngineOptimizationPatches() {
SafeWrite32(0x4D630C, 0x9090C031); // xor eax, eax
SafeWrite8(0x4D6310, 0x90);
BlockCall(0x4D6319);
+
+ // Reduce excessive delays in the save/load game screens
+ const DWORD lsGameDelayAddr[] = {
+ 0x47D00D, // LoadGame_
+ 0x47C1FD // SaveGame_
+ };
+ SafeWriteBatch(16, lsGameDelayAddr); // 41 to 16 ms
+ // LoadGame_
+ SafeWrite8(0x47CF0D, 195 + 10); // jz +10
+ // SaveGame_
+ SafeWrite8(0x47C135, 140 + 10); // jz +10
}
void MiscPatches::init() {
diff --git a/sfall/Modules/Scripting/Handlers/Objects.cpp b/sfall/Modules/Scripting/Handlers/Objects.cpp
index 2466c972..59487d31 100644
--- a/sfall/Modules/Scripting/Handlers/Objects.cpp
+++ b/sfall/Modules/Scripting/Handlers/Objects.cpp
@@ -120,10 +120,10 @@ void op_get_npc_level(OpcodeContext& ctx) {
}
if (pid) {
DWORD* pidList = *fo::ptr::partyMemberPidList;
- DWORD* lvlUpInfo = *fo::ptr::partyMemberLevelUpInfoList;
+ DWORD* levelUpInfoList = *fo::ptr::partyMemberLevelUpInfoList;
for (DWORD j = 0; j < *fo::ptr::partyMemberMaxCount; j++) {
if (pidList[j] == pid) {
- level = lvlUpInfo[j * 3];
+ level = levelUpInfoList[j * 3];
break;
}
}