From 599ebbc0ad7cef4d9cc467885bb6516a79633d19 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 24 Jun 2023 19:24:15 +0200 Subject: [PATCH] Only apply relevant oils in multiplayer --- Source/loadsave.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index ff13e1b4436..a9a2ed1332a 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -947,12 +947,6 @@ bool IsShopPriceValid(const Item &item) return true; } -void RevertEffectsOfMultiplayerOils(Item &heroItem, const Item &unpackedItem) -{ - heroItem._iPLToHit = unpackedItem._iPLToHit; // Oil of Accuracy - heroItem._iMaxDam = unpackedItem._iMaxDam; // Oil of Sharpness -} - void LoadMatchingItems(LoadHelper &file, const Player &player, const int n, Item *pItem) { Item heroItem; @@ -977,10 +971,13 @@ void LoadMatchingItems(LoadHelper &file, const Player &player, const int n, Item unpackedItem.clear(); continue; } - if (!gbIsHellfire) - RevertEffectsOfMultiplayerOils(heroItem, unpackedItem); + if (gbIsHellfire) { + unpackedItem._iPLToHit = ClampToHit(unpackedItem, heroItem._iPLToHit); // Oil of Accuracy + unpackedItem._iMaxDam = ClampMaxDam(unpackedItem, heroItem._iMaxDam); // Oil of Sharpness + } + } else { + unpackedItem = heroItem; } - unpackedItem = heroItem; } }