Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#432 closed bug (fixed (in master))

Negative gold when buying from store

Reported by: takkaria Owned by:
Milestone: 3.1.0 Keywords:

Change History (3)

comment:1 Changed 13 years ago by roustk@…

See thread for full discussion.

The bug involves buying wands/staffs and the fact that the player always
buys a wad with above-average charges (and thus above-average price).

In store.c (revision 681), line 1908 checks that the player can afford the
average price in the stack, but line 1985 deducts the true price without
checking that it is affordable.

Suggested fix: at line 1985 add the following

                /* Spend the money */
                p_ptr->au -= price;

                /* Hack -- force au to be non-negative */ 
                /* Player may not be able to afford above-average wand, 
                   even if they can afford an average one. */
                if (p_ptr->au < 0) p_ptr->au = 0L;


comment:2 Changed 13 years ago by GabeCunningham

  • Resolution set to fixed
  • Status changed from new to closed

comment:3 Changed 13 years ago by GabeCunningham

Fixed in [b1b42b4] (SVN r793).

Note: See TracTickets for help on using tickets.