mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed crash in an encounter between two groups
* when they are set to fight each other but one group fails to spawn. (ref. BGforgeNet/Fallout2_Restoration_Project#350) Updated version number.
This commit is contained in:
@@ -3604,6 +3604,21 @@ skip:
|
||||
}
|
||||
}
|
||||
|
||||
static __declspec(naked) void wmSetupRandomEncounter_hack() {
|
||||
static const DWORD wmSetupRandomEncounter_Ret = 0x4C11DB;
|
||||
__asm {
|
||||
test edx, edx; // critter
|
||||
jz skip;
|
||||
// overwritten engine code
|
||||
mov [esi + whoHitMe], edx;
|
||||
mov [edx + whoHitMe], esi;
|
||||
retn;
|
||||
skip:
|
||||
add esp, 4;
|
||||
jmp wmSetupRandomEncounter_Ret;
|
||||
}
|
||||
}
|
||||
|
||||
void BugFixes::init() {
|
||||
#ifndef NDEBUG
|
||||
LoadGameHook::OnBeforeGameClose() += PrintAddrList;
|
||||
@@ -4470,6 +4485,9 @@ void BugFixes::init() {
|
||||
|
||||
// Fix crash when a critter with a powered melee/unarmed weapon runs out of ammo and there is ammo nearby
|
||||
MakeCall(0x47887B, item_w_can_reload_hack);
|
||||
|
||||
// Fix crash when an encounter between two groups fighting each other fails to spawn one group
|
||||
MakeCall(0x4C119A, wmSetupRandomEncounter_hack, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -25,6 +25,6 @@
|
||||
#define VERSION_MAJOR 4
|
||||
#define VERSION_MINOR 4
|
||||
#define VERSION_BUILD 7
|
||||
#define VERSION_REV 0
|
||||
#define VERSION_REV 1
|
||||
|
||||
#define VERSION_STRING "4.4.7"
|
||||
#define VERSION_STRING "4.4.7.1"
|
||||
|
||||
Reference in New Issue
Block a user