mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Merge branch 'feature/restore-sneak-between-maps'
Minor edit to documents.
This commit is contained in:
@@ -702,7 +702,7 @@
|
|||||||
opcode: 0x8236
|
opcode: 0x8236
|
||||||
- name: party_member_list
|
- name: party_member_list
|
||||||
detail: array party_member_list(int includeHidden)
|
detail: array party_member_list(int includeHidden)
|
||||||
doc: Returns an array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)
|
doc: Returns an array of all current party members (0 - only critters that are alive and visible will be returned, 1 - all objects, including the car trunk, etc.)
|
||||||
opcode: 0x8271
|
opcode: 0x8271
|
||||||
|
|
||||||
- name: Explosions
|
- name: Explosions
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ FUNCTION REFERENCE
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
##### `array party_member_list(int includeHidden)`
|
##### `array party_member_list(int includeHidden)`
|
||||||
- Returns an array of all current party members (0 - only critter-type, alive and visible will be returned, 1 - all object, including Trunk, etc.)
|
- Returns an array of all current party members (0 - only critters that are alive and visible will be returned, 1 - all objects, including the car trunk, etc.)
|
||||||
|
|
||||||
-----
|
-----
|
||||||
##### `array path_find_to(object objFrom, int tileTo, int blockingType)`
|
##### `array path_find_to(object objFrom, int tileTo, int blockingType)`
|
||||||
|
|||||||
@@ -867,12 +867,17 @@ void SetGlobals(GlobalVar* globals) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DWORD pcFlagSneak;
|
||||||
|
|
||||||
static __declspec(naked) void map_save_in_game_hook() {
|
static __declspec(naked) void map_save_in_game_hook() {
|
||||||
__asm {
|
__asm {
|
||||||
test cl, 1;
|
test cl, 1;
|
||||||
jz skip;
|
jz skip;
|
||||||
mov ScriptExtender::OnMapLeave, 1;
|
mov ScriptExtender::OnMapLeave, 1;
|
||||||
call fo::funcoffs::scr_exec_map_exit_scripts_;
|
call fo::funcoffs::scr_exec_map_exit_scripts_;
|
||||||
|
xor eax, eax;
|
||||||
|
call fo::funcoffs::is_pc_flag_;
|
||||||
|
mov pcFlagSneak, eax; // save sneak state
|
||||||
mov ScriptExtender::OnMapLeave, 0;
|
mov ScriptExtender::OnMapLeave, 0;
|
||||||
retn;
|
retn;
|
||||||
skip:
|
skip:
|
||||||
@@ -880,6 +885,18 @@ skip:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static __declspec(naked) void map_load_file_hook() {
|
||||||
|
__asm {
|
||||||
|
cmp pcFlagSneak, 0;
|
||||||
|
jz skip;
|
||||||
|
xor eax, eax;
|
||||||
|
mov pcFlagSneak, eax;
|
||||||
|
call fo::funcoffs::pc_flag_on_;
|
||||||
|
skip:
|
||||||
|
jmp fo::funcoffs::scr_exec_map_enter_scripts_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void ClearEventsOnMapExit() {
|
static void ClearEventsOnMapExit() {
|
||||||
using namespace fo;
|
using namespace fo;
|
||||||
__asm {
|
__asm {
|
||||||
@@ -985,6 +1002,8 @@ void ScriptExtender::init() {
|
|||||||
HookCall(0x483CC3, (void*)fo::funcoffs::partyMemberSaveProtos_);
|
HookCall(0x483CC3, (void*)fo::funcoffs::partyMemberSaveProtos_);
|
||||||
HookCall(0x483CC8, (void*)fo::funcoffs::partyMemberPrepLoad_);
|
HookCall(0x483CC8, (void*)fo::funcoffs::partyMemberPrepLoad_);
|
||||||
HookCall(0x483CCD, (void*)fo::funcoffs::partyMemberPrepItemSaveAll_);
|
HookCall(0x483CCD, (void*)fo::funcoffs::partyMemberPrepItemSaveAll_);
|
||||||
|
// Tweak for restoring the sneak state when switching between maps
|
||||||
|
HookCall(0x4830B6, map_load_file_hook);
|
||||||
|
|
||||||
// Set the DAM_BACKWASH flag for the attacker before calling compute_damage_
|
// Set the DAM_BACKWASH flag for the attacker before calling compute_damage_
|
||||||
SafeWrite32(0x423DE7, 0x40164E80); // or [esi+ctd.flags3Source], DAM_BACKWASH_
|
SafeWrite32(0x423DE7, 0x40164E80); // or [esi+ctd.flags3Source], DAM_BACKWASH_
|
||||||
|
|||||||
Reference in New Issue
Block a user