Skip to content

Commit

Permalink
Changed the world map healing rate patch to be enabled by default
Browse files Browse the repository at this point in the history
* default 3 hrs according to Fallout v1.2 manual errata.

Changed AIDrugUsePerfFix to be enabled by default (UPU/RPU have it
enabled for years, and F2:CE also implemented a similar fix.)

Updated version number.
  • Loading branch information
NovaRain committed May 28, 2024
1 parent 0631f97 commit 0ba74de
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions artifacts/ddraw.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.4.3.1
;v4.4.4

[Main]
;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash
Expand Down Expand Up @@ -767,7 +767,7 @@ AIBestWeaponFix=1
;Set to 2 to allow NPCs to use only the drugs listed in chem_primary_desire and healing drugs (stimpaks and healing powder)
;Note: chem_primary_desire without fixes prevents the specified item from being consumed if all three values in the list are the same PID
;chem_primary_desire also works as a priority list of drug items the NPC will try to pick up in combat when they are on the ground
AIDrugUsePerfFix=0
AIDrugUsePerfFix=1

;Set to 1 to fix the bug of using First Aid/Doctor skills when using them on the player
;This will cause the party member to perform First Aid/Doctor skills when you use them on the player, but only if
Expand Down
4 changes: 2 additions & 2 deletions artifacts/scripting/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1432,8 +1432,8 @@
- name: set_worldmap_heal_time
detail: void set_worldmap_heal_time(int time)
doc: |
Sets the time interval in minutes for healing during world map travel
- passing 0 will revert to 1 second in real time (vanilla engine behavior)
Sets the time interval in minutes for healing during world map travel. The default is 180
- passing 0 will revert to 1 second of real time (vanilla engine behavior)
- passing -1 will disable healing during travel
- the time interval will be reset each time the player reloads the game
macro: sfall.h
Expand Down
4 changes: 2 additions & 2 deletions artifacts/scripting/sfall function notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,8 @@ sfall_funcX metarule functions
----
#### set_worldmap_heal_time
`void sfall_func1("set_worldmap_heal_time", int minutes)`
- Sets the time interval in minutes for healing during world map travel
- Passing 0 will revert to 1 second in real time (vanilla engine behavior)
- Sets the time interval in minutes for healing during world map travel. The default is 180
- Passing 0 will revert to 1 second of real time (vanilla engine behavior)
- Passing -1 will disable healing during travel
- The time interval will be reset each time the player reloads the game

Expand Down
4 changes: 2 additions & 2 deletions sfall/Game/combatAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source) {
if (counter <= 2) break; // there is a match

// [FIX] for AI not taking chem_primary_desire in AI.txt as a preference list when using drugs in the inventory
if (drugUsePerfFixMode == 1) {
if (drugUsePerfFixMode != 2) {
counter = 0;
item = fo::func::inven_find_type(source, fo::ItemType::item_type_drug, &slot);
if (!item) {
Expand Down Expand Up @@ -202,7 +202,7 @@ void CombatAI::init() {
sf::SafeWrite8(0x429BE9, sf::CodeType::JumpNZ); // jz > jnz
sf::SafeWrite8(0x429BF1, sf::CodeType::JumpShort); // jnz > jmp

drugUsePerfFixMode = sf::IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 0);
drugUsePerfFixMode = sf::IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 1);
if (drugUsePerfFixMode > 0) sf::dlogr("Applying AI drug use preference fix.", DL_FIX);
}

Expand Down
6 changes: 3 additions & 3 deletions sfall/Modules/BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,7 @@ static void __declspec(naked) determine_to_hit_func_hook() {
static void __declspec(naked) process_rads_hack() {
static const DWORD process_rads_Ret = 0x42D708;
__asm {
test ebp, ebp;
test ebp, ebp; // modifier: -1 - recovery, 1 - downgrade level
jl fix;
test byte ptr [ecx + damageFlags], DAM_DEAD;
jnz fix;
Expand Down Expand Up @@ -3920,10 +3920,10 @@ void BugFixes::init() {
// Display a pop-up message box about death from radiation
HookCall(0x42D733, process_rads_hook_msg);

//int drugUsePerfFix = IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 0);
//int drugUsePerfFix = IniReader::GetConfigInt("Misc", "AIDrugUsePerfFix", 1);
//if (drugUsePerfFix > 0) {
// dlogr("Applying AI drug use preference fix.", DL_FIX);
// if (drugUsePerfFix == 1) {
// if (drugUsePerfFix != 2) {
// // Fix for AI not taking chem_primary_desire in AI.txt as a preference list when using drugs in the inventory
// MakeCall(0x42869D, ai_check_drugs_hack_break);
// MakeCall(0x4286AB, ai_check_drugs_hack_check, 1);
Expand Down
2 changes: 1 addition & 1 deletion sfall/Modules/Worldmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static DWORD worldMapTicks;

static DWORD WorldMapEncounterRate;

static constexpr long WorldMapHealingDefaultInterval = 0;
static constexpr long WorldMapHealingDefaultInterval = 180 * 60 * 10; // 3 hrs
// Healing interval in game time
static long worldMapHealingInterval = WorldMapHealingDefaultInterval;
static DWORD worldMapLastHealTime;
Expand Down
6 changes: 3 additions & 3 deletions sfall/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define VERSION_MAJOR 4
#define VERSION_MINOR 4
#define VERSION_BUILD 3
#define VERSION_REV 2
#define VERSION_BUILD 4
#define VERSION_REV 0

#define VERSION_STRING "4.4.3.2"
#define VERSION_STRING "4.4.4"

0 comments on commit 0ba74de

Please sign in to comment.