Fixed item planting for non-biped critters with the "barter" flag set

(BGforgeNet/Fallout2_Unofficial_Patch#95)

Updated version number.
This commit is contained in:
NovaRain
2022-04-04 21:31:51 +08:00
parent c3f6b0ebb6
commit 4e3d8a62ca
4 changed files with 32 additions and 6 deletions
+2 -2
View File
@@ -4,10 +4,10 @@
Key=42
; Set to 1 to also highlight containers
Containers=1
Containers=0
; Set to 1 to also highlight lootable corpses
Corpses=1
Corpses=0
; Set to 1 to only highlight objects in the player's line-of-sight
CheckLOS=0
+1 -1
View File
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.3.3.2
;v4.3.4
[Main]
;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash
+26
View File
@@ -3144,6 +3144,29 @@ noObject:
}
}
// returns 0 (biped) if the critter has the "barter" flag set
static long __fastcall BarterOverrideBodyType(fo::GameObject* critter) {
return (fo::util::GetProto(critter->protoId)->critter.critterFlags & fo::CritterFlags::Barter)
? fo::BodyType::Biped
: fo::BodyType::Quadruped;
}
static void __declspec(naked) item_add_mult_hook_body_type() {
__asm {
call fo::funcoffs::critter_body_type_;
test eax, eax;
jnz notBiped;
retn;
notBiped:
push edx;
push ecx;
call BarterOverrideBodyType; // ecx - critter
pop ecx;
pop edx;
retn;
}
}
void BugFixes::init()
{
#ifndef NDEBUG
@@ -3961,6 +3984,9 @@ void BugFixes::init()
// Fix incorrect value of the limit number of floating messages
SafeWrite8(0x4B039F, 20); // text_object_create_ (was 19)
// Fix for being unable to plant items on non-biped critters with the "Barter" flag set
HookCall(0x477183, item_add_mult_hook_body_type);
}
}
+3 -3
View File
@@ -24,7 +24,7 @@
#define VERSION_MAJOR 4
#define VERSION_MINOR 3
#define VERSION_BUILD 3
#define VERSION_REV 2
#define VERSION_BUILD 4
#define VERSION_REV 0
#define VERSION_STRING "4.3.3.2"
#define VERSION_STRING "4.3.4"