Dev build/Linux: can drop up to 399 gold over limit in wagon [RESOLVED]

Locked
User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Dev build/Linux: can drop up to 399 gold over limit in wagon [RESOLVED]

Post by pango »

One can drop up to 399 gold over limit in wagon because wagon capacity check uses an integer division for gold:

Code: Select all

            // Check wagon weight limit
            if (usingWagon && (remoteItems.GetWeight() + (goldToDrop / DaggerfallBankManager.gold1kg) > ItemHelper.wagonKgLimit))
                return;
More generally, I wonder if/how code could be shared with stack splitting:
  • player gold is handled as an int instead of a DaggerfallUnityItem;
  • dropping gold uses dedicated message:
    • WagonCanHoldAmount() mush be used carefully as it can itself display a message if no item can be dropped;
    • I think player gold amount is inserted into dedicated message by a macro, so no other amount can be used if the wagon capacity is the limiting factor;
    • some players (including myself) came to rely on this message to know how many gold pieces they have in their inventory (character sheet includes letters of credit).
  • when you try to drop more gold in your wagon that it can hold (well, plus 399), action is silently discarded; So to drop as much gold as you can becomes a process of trial and error.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Dev build/Linux: can drop up to 399 gold over limit in wagon

Post by pango »

I created a PR
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Locked