mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Minor edits to ItemCounterAutoCaps
This commit is contained in:
+2
-1
@@ -662,7 +662,8 @@ ReloadReserve=-1
|
|||||||
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number, except in the barter screen
|
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number, except in the barter screen
|
||||||
ItemCounterDefaultMax=0
|
ItemCounterDefaultMax=0
|
||||||
|
|
||||||
;Set to 1 to enable caps auto-balancing: when dragging caps between tables in the barter screen, 'Move Items' window will be shown with correct number pre-filled that balances the tables
|
;Set to 1 to enable money/caps auto-balancing in the barter screen
|
||||||
|
;When moving money/caps to or from the table, the 'Move Items' window will be pre-filled with the correct balancing amount
|
||||||
ItemCounterAutoCaps=0
|
ItemCounterAutoCaps=0
|
||||||
|
|
||||||
;Set to 1 to leave the music playing in dialogue with talking heads
|
;Set to 1 to leave the music playing in dialogue with talking heads
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
#include "GamePids.h"
|
|
||||||
#include "FunctionOffsets.h"
|
#include "FunctionOffsets.h"
|
||||||
#include "Structs.h"
|
#include "Structs.h"
|
||||||
#include "EngineUtils.h"
|
#include "EngineUtils.h"
|
||||||
|
|||||||
@@ -55,11 +55,6 @@ static DWORD __fastcall BarterPriceHook_Script(fo::GameObject* source, fo::GameO
|
|||||||
cost = rets[0]; // new cost for npc
|
cost = rets[0]; // new cost for npc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isPCHook) {
|
|
||||||
lastTableCostPC = cost;
|
|
||||||
} else {
|
|
||||||
lastTableCostNPC = cost;
|
|
||||||
}
|
|
||||||
EndHook();
|
EndHook();
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
@@ -74,6 +69,7 @@ static void __declspec(naked) BarterPriceHook() {
|
|||||||
call BarterPriceHook_Script; // edx - target
|
call BarterPriceHook_Script; // edx - target
|
||||||
pop ecx;
|
pop ecx;
|
||||||
pop edx;
|
pop edx;
|
||||||
|
mov lastTableCostNPC, eax;
|
||||||
retn;
|
retn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,6 +85,7 @@ static void __declspec(naked) PC_BarterPriceHook() {
|
|||||||
call BarterPriceHook_Script;
|
call BarterPriceHook_Script;
|
||||||
pop ecx;
|
pop ecx;
|
||||||
pop edx;
|
pop edx;
|
||||||
|
mov lastTableCostPC, eax;
|
||||||
retn;
|
retn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -623,8 +623,7 @@ static long CalculateSuggestedMoveCount(fo::GameObject* item, long maxQuantity,
|
|||||||
// This is an exact copy of logic from https://github.com/alexbatalov/fallout2-ce/pull/311
|
// This is an exact copy of logic from https://github.com/alexbatalov/fallout2-ce/pull/311
|
||||||
if (item->protoId == fo::PID_BOTTLE_CAPS && !fo::var::dialog_target_is_party) {
|
if (item->protoId == fo::PID_BOTTLE_CAPS && !fo::var::dialog_target_is_party) {
|
||||||
// Calculate change money automatically
|
// Calculate change money automatically
|
||||||
long totalCostPlayer;
|
long totalCostPlayer, totalCostNpc;
|
||||||
long totalCostNpc;
|
|
||||||
BarterPriceHook_GetLastCosts(totalCostPlayer, totalCostNpc);
|
BarterPriceHook_GetLastCosts(totalCostPlayer, totalCostNpc);
|
||||||
// Actor's balance: negative - the actor must add money to balance the tables and vice versa
|
// Actor's balance: negative - the actor must add money to balance the tables and vice versa
|
||||||
long balance = fromPlayer ? totalCostPlayer - totalCostNpc : totalCostNpc - totalCostPlayer;
|
long balance = fromPlayer ? totalCostPlayer - totalCostNpc : totalCostNpc - totalCostPlayer;
|
||||||
@@ -811,8 +810,8 @@ void Inventory::init() {
|
|||||||
skipFromContainer = IniReader::GetConfigInt("Input", "FastMoveFromContainer", 0);
|
skipFromContainer = IniReader::GetConfigInt("Input", "FastMoveFromContainer", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
itemCounterDefaultMax = IniReader::GetConfigInt("Misc", "ItemCounterDefaultMax", 0);
|
itemCounterDefaultMax = (IniReader::GetConfigInt("Misc", "ItemCounterDefaultMax", 0) != 0);
|
||||||
itemCounterAutoCaps = IniReader::GetConfigInt("Misc", "ItemCounterAutoCaps", 0);
|
itemCounterAutoCaps = (IniReader::GetConfigInt("Misc", "ItemCounterAutoCaps", 0) != 0);
|
||||||
if (itemCounterDefaultMax || itemCounterAutoCaps) {
|
if (itemCounterDefaultMax || itemCounterAutoCaps) {
|
||||||
MakeCall(0x4768A3, do_move_timer_hack);
|
MakeCall(0x4768A3, do_move_timer_hack);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user