Skip to content

Commit

Permalink
- Fixed the floating point error on coin pieces
Browse files Browse the repository at this point in the history
  • Loading branch information
agilbert1412 committed Sep 22, 2024
1 parent f6ef7f0 commit f7e0a4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DLCQuestipelago/DLCQuestipelago.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net452</TargetFramework>
<AssemblyName>DLCQuestipelago</AssemblyName>
<Description>Archipelago Randomizer for DLC Quest</Description>
<Version>3.1.0</Version>
<Version>3.1.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<BaseOutputPath>bin\</BaseOutputPath>
Expand Down
2 changes: 2 additions & 0 deletions DLCQuestipelago/Items/HandleCoinChangedPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ private static void Postfix(CoinDisplay __instance, int numCoins)

var currentCoins = CoinsanityUtils.GetCurrentCoins(_archipelago);

currentCoins = Math.Round(currentCoins, 2);

// protected HUDText coinCount;
var coinCountField = typeof(CoinDisplay).GetField("coinCount", BindingFlags.Instance | BindingFlags.NonPublic);
var coinCount = (HUDText)coinCountField.GetValue(__instance);
Expand Down
2 changes: 2 additions & 0 deletions DLCQuestipelago/Shop/StoreScreenSelectionChangedPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ private static void UpdateInventoryAndPrice(DLCDetailPanel detailPanel, DLCPackD
var numberCoins = useBossCoins
? Singleton<SceneManager>.Instance.CurrentScene.Player.Inventory.BossCoins
: CoinsanityUtils.GetCurrentCoins(_archipelago);
numberCoins = Math.Round(numberCoins, 2);

if (numberCoins >= selectedDLCData.Cost)
{
priceCoinAmountText.Tint = ColorUtil.PriceCanAffordText;
Expand Down

0 comments on commit f7e0a4c

Please sign in to comment.