Skip to content

Commit

Permalink
Only apply relevant oils in multiplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
AJenbo committed Jul 9, 2023
1 parent 11e0ccd commit 599ebbc
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Source/loadsave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 599ebbc

Please sign in to comment.