File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -820,7 +820,7 @@ static __declspec(naked) void inven_pickup_skip_drag_hack() {
820820}
821821
822822static int invenApCost, invenApCostDef;
823- static char invenApQPReduction;
823+ static signed char invenApQPReduction;
824824
825825static __declspec (naked) void inven_ap_cost_hack() {
826826 __asm {
@@ -837,13 +837,13 @@ inline static void ApplyInvenApCostPatch() {
837837}
838838
839839void __fastcall Inventory::SetInvenApCost (int cost) {
840- invenApCost = cost;
840+ invenApCost = (cost < 0 ) ? 0 : cost;
841841 if (!onlyOnceAP) ApplyInvenApCostPatch ();
842842}
843843
844844long Inventory::GetInvenApCost () {
845845 long perkLevel = fo::func::perk_level (fo::var::obj_dude, fo::PERK_quick_pockets);
846- return invenApCost - (invenApQPReduction * perkLevel);
846+ return max ( 0 , invenApCost - (invenApQPReduction * perkLevel) );
847847}
848848
849849void InventoryReset () {
You can’t perform that action at this time.
0 commit comments