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:
@@ -3588,6 +3588,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;
|
||||
}
|
||||
}
|
||||
|
||||
// Missing game initialization
|
||||
void BugFixes::OnBeforeGameInit() {
|
||||
Initialization();
|
||||
@@ -4481,6 +4496,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 3
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_BUILD 47
|
||||
#define VERSION_REV 0
|
||||
#define VERSION_REV 1
|
||||
|
||||
#define VERSION_STRING "3.8.47"
|
||||
#define VERSION_STRING "3.8.47.1"
|
||||
|
||||
Reference in New Issue
Block a user