Added a fix to display a pop-up message box about death from radiation.

This commit is contained in:
NovaRain
2018-11-13 21:37:48 +08:00
parent 627fe11c29
commit 719cec74d1
4 changed files with 35 additions and 1 deletions
+15
View File
@@ -1528,6 +1528,18 @@ noRange:
}
}
static void __declspec(naked) process_rads_hook() {
__asm {
push eax;
call display_print_;
mov ebx, dword ptr ds:[_game_user_wants_to_quit];
mov dword ptr ds:[_game_user_wants_to_quit], 0;
call DialogOut;
mov dword ptr ds:[_game_user_wants_to_quit], ebx;
retn;
}
}
void BugsInit()
{
@@ -1947,4 +1959,7 @@ void BugsInit()
// Fix for determine_to_hit_func_ engine function taking distance into account when called from determine_to_hit_no_range_
HookCall(0x4244C3, determine_to_hit_func_hook);
// Display a pop-up messages box about death from radiation
HookCall(0x42D733, process_rads_hook);
}
+17
View File
@@ -904,6 +904,23 @@ long __stdcall WinRegisterButton(DWORD winRef, long xPos, long yPos, long width,
}
}
void __stdcall DialogOut(const char* text) {
__asm {
push 1 // flag
xor eax, eax
push eax // ColorMsg
push eax // DisplayMsg
mov al, ds:[0x6AB718]
push eax // ColorIndex
push 0x74 // y
mov ecx, 0xC0 // x
mov eax, text // DisplayText
xor ebx, ebx // ?
xor edx, edx // ?
call dialog_out_
}
}
long __fastcall WordWrap(const char* text, int maxWidth, DWORD* buf, BYTE* count) {
__asm {
mov eax, ecx
+2
View File
@@ -983,6 +983,8 @@ long __stdcall CreateWindowFunc(const char* winName, long x, long y, long width,
// creates a button
long __stdcall WinRegisterButton(DWORD winRef, long xPos, long yPos, long width, long height, long hoverOn, long hoverOff, long buttonDown, long buttonUp, BYTE* pictureUp, BYTE* pictureDown, long arg12, long buttonType);
void __stdcall DialogOut(const char* text);
long __fastcall WordWrap(const char* text, int maxWidth, DWORD* buf, BYTE* count);
void __stdcall RedrawWin(DWORD winRef);
+1 -1
View File
@@ -37,7 +37,7 @@ struct sGlobalVar {
#define SCRIPT_PROC_MAX (27)
typedef struct {
DWORD ptr;
DWORD procLookup[SCRIPT_PROC_MAX+1];
DWORD procLookup[SCRIPT_PROC_MAX + 1];
char initialized;
} sScriptProgram;