diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 9764f0ff..353008a6 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -1,5 +1,5 @@ ;sfall configuration settings -;v3.8.33.2 +;v3.8.34 [Main] ;Set to 1 if you want to use command line arguments to tell sfall to use another ini file @@ -182,10 +182,10 @@ WindowScrollKey=0 ToggleItemHighlightsKey=42 ;Set to 1 to also highlight containers -HighlightContainers=1 +HighlightContainers=0 ;Set to 1 to also highlight lootable corpses -HighlightCorpses=1 +HighlightCorpses=0 ;Set the color of outlines, available colors: ;1 - glowing red diff --git a/artifacts/example_mods/ItemHighlight_Lite/sfall-mods.ini b/artifacts/example_mods/ItemHighlight_Lite/sfall-mods.ini index 9c6d4b9d..95d09da4 100644 --- a/artifacts/example_mods/ItemHighlight_Lite/sfall-mods.ini +++ b/artifacts/example_mods/ItemHighlight_Lite/sfall-mods.ini @@ -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 diff --git a/sfall/FalloutEngine/Enums.h b/sfall/FalloutEngine/Enums.h index 1621e0c5..13a129a5 100644 --- a/sfall/FalloutEngine/Enums.h +++ b/sfall/FalloutEngine/Enums.h @@ -653,6 +653,13 @@ enum AttackSubType : long GUNS = 4 }; +enum BodyType : long +{ + Biped = 0, + Quadruped = 1, + Robotic = 2 +}; + enum KillType : long { KILL_TYPE_men = 0, diff --git a/sfall/Modules/BugFixes.cpp b/sfall/Modules/BugFixes.cpp index 043d4721..fcd3416e 100644 --- a/sfall/Modules/BugFixes.cpp +++ b/sfall/Modules/BugFixes.cpp @@ -3128,6 +3128,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; + } +} + // Missing game initialization void BugFixes::OnBeforeGameInit() { Initialization(); @@ -3967,6 +3990,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); } } diff --git a/sfall/version.h b/sfall/version.h index f96db51a..884bd9f5 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -24,7 +24,7 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 8 -#define VERSION_BUILD 33 -#define VERSION_REV 2 +#define VERSION_BUILD 34 +#define VERSION_REV 0 -#define VERSION_STRING "3.8.33.2" +#define VERSION_STRING "3.8.34"