Re-fixed setting DIALOG game mode flag

This commit is contained in:
NovaRain
2020-01-06 00:19:36 +08:00
parent 28dc256f61
commit 1e0b048e9e
4 changed files with 6 additions and 10 deletions
+1
View File
@@ -381,6 +381,7 @@ const DWORD gdialog_barter_cleanup_tables_ = 0x448660;
const DWORD gdialog_barter_pressed_ = 0x44A52C;
const DWORD gdialogActive_ = 0x444D2C;
const DWORD gdialogDisplayMsg_ = 0x445448;
const DWORD gdialogFreeSpeech_ = 0x4450C4;
const DWORD gdProcess_ = 0x4465C0;
const DWORD gdReviewExit_ = 0x445C18;
const DWORD gdReviewInit_ = 0x445938;
+1
View File
@@ -620,6 +620,7 @@ extern const DWORD gdialog_barter_cleanup_tables_;
extern const DWORD gdialog_barter_pressed_;
extern const DWORD gdialogActive_;
extern const DWORD gdialogDisplayMsg_;
extern const DWORD gdialogFreeSpeech_;
extern const DWORD gdProcess_;
extern const DWORD gdReviewExit_;
extern const DWORD gdReviewInit_;
+1 -1
View File
@@ -18,7 +18,7 @@
#pragma once
long __stdcall GetInvenApCost() ;
long __stdcall GetInvenApCost();
void __fastcall SetInvenApCost(int cost);
DWORD __stdcall sf_item_total_size(TGameObj* critter);
+3 -9
View File
@@ -475,16 +475,10 @@ static void __declspec(naked) DialogHookStart() {
}
}
static void __declspec(naked) DialogHook() {
static void __declspec(naked) DialogHookEnd() {
__asm {
test inLoop, DIALOG; // check byte flag
jz changeMode;
jmp gdProcess_;
changeMode:
or inLoop, DIALOG;
call gdProcess_;
and inLoop, (-1 ^ DIALOG);
retn;
jmp gdialogFreeSpeech_;
}
}
@@ -652,7 +646,7 @@ void LoadGameHookInit() {
//HookCall(0x4A73EB, CharacterHook); // character creation
//HookCall(0x4A740A, CharacterHook); // character creation
MakeCall(0x445285, DialogHookStart); // gdialogInitFromScript_
HookCall(0x445748, DialogHook);
HookCall(0x4452CD, DialogHookEnd); // gdialogExitFromScript_ (old 0x445748)
HookCall(0x443463, PipboyHook);
HookCall(0x443605, PipboyHook);
HookCall(0x4434AC, SkilldexHook);