mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added optimization for the save/load game screens
Edited the description of args for HOOK_TOHIT.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -661,7 +661,7 @@ sfall_funcX metarule functions
|
||||
|
||||
----
|
||||
#### inventory_redraw
|
||||
`void sfall_func0("inventory_redraw")`<br>
|
||||
`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)`<br>
|
||||
`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
|
||||
|
||||
@@ -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<BYTE>(16, lsGameDelayAddr); // 41 to 16 ms
|
||||
// LoadGame_
|
||||
SafeWrite8(0x47CF0D, 195 + 10); // jz +10
|
||||
// SaveGame_
|
||||
SafeWrite8(0x47C135, 140 + 10); // jz +10
|
||||
}
|
||||
|
||||
void MiscPatches::init() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user