Skip to content

Commit

Permalink
no longer use Coins Weight for coin weight in party inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos committed Jun 11, 2022
1 parent 51981e0 commit 4ff404a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions extension.xml
Expand Up @@ -3,12 +3,12 @@
<root version="3.1">
<properties>
<name>Feature: Party Inventory Weight</name>
<version>1.4</version>
<version>1.5</version>
<author>bmos</author>
<description>Adds weight to party sheet inventory</description>
</properties>

<announcement text="https://www.fantasygrounds.com/forums/showthread.php?69117-CoreRPG-Party-Item-Weight\rCoreRPG - Party Item Weight v1.4\nFor Fantasy Grounds v4.1+\nBy bmos" font="emotefont"/>
<announcement text="https://www.fantasygrounds.com/forums/showthread.php?69117-CoreRPG-Party-Item-Weight\rCoreRPG - Party Item Weight v1.5\nFor Fantasy Grounds v4.1+\nBy bmos" font="emotefont"/>

<base>
<!-- Party sheet -->
Expand Down
10 changes: 3 additions & 7 deletions scripts/parcelweight.lua
Expand Up @@ -15,15 +15,11 @@ end
-- luacheck: globals calculateCoinWeight
function calculateCoinWeight(node_parcel_coins)
local number_coins_total = 0
if CoinsWeight and CoinsWeight.aDenominations then
if OptionsManager.isOption("CURR", "on") then
for _, node_party_coin in pairs(node_parcel_coins.getChildren()) do
local string_coin_description = DB.getValue(node_party_coin, 'description', ''):lower()
if CoinsWeight.aDenominations[string_coin_description] then
number_coins_total = number_coins_total +
(DB.getValue(node_party_coin, 'amount', 0) * CoinsWeight.aDenominations[string_coin_description]['nWeight'])
else
number_coins_total = number_coins_total + (DB.getValue(node_party_coin, 'amount', 0) * CoinsWeight.nDefaultCoinWeight)
end
number_coins_total = number_coins_total +
(DB.getValue(node_party_coin, 'amount', 0) * CurrencyManager.getCurrencyRecord(string_coin_description)['nWeight'])
end
end
return number_coins_total
Expand Down

0 comments on commit 4ff404a

Please sign in to comment.