Go Back   Angband Forums > Angband > Vanilla

Thread Tools Display Modes
Old December 3, 2011, 00:47   #1
PowerWyrm's Avatar
Join Date: Apr 2008
Posts: 2,806
PowerWyrm is on a distinguished road
[3.3.x] Severe bug -- pricing system

Guess I found a really nasty bug...

Was looking at BM items when I saw some Ring of the Dog priced at 999999999 au. After saving the game and loading it again, the ring was priced at 0 gold.

So I launched the game in debug mode and found the explanation. In object_power(), object flags which contribute to pval will give a power boost stored in the extra_stat_bonus variable. For each pval, the boost is calculated as pval * pval_mult... which is of course negative for any negative pval. Some objects like Rings of the Dog or Amulets of Inertia have a single negative pval. The resulting extra_stat_bonus is then negative. However, extra power is added for objects with high ability bonuses using extra_stat_bonus as an index in a static array:

pwr += ability_power[extra_stat_bonus / 10];
With extra_stat_bonus negative, the index is out of bounds! The result is completely random, and could even crash on some machines...
PWMAngband variant maintainer - check (or to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old December 3, 2011, 07:47   #2
Angband Devteam member
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Bugs like this always amaze me - rings of the dog can't be that unusual in the BM, so how come nobody's come across it before??

Well spotted - thanks.

Opened as #1592
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Resist system Jungle_Boy Development 65 August 30, 2011 04:10
New pricing Magnate Vanilla 1 April 17, 2011 00:40
Yet Another Pricing Bug d_m Vanilla 1 August 31, 2010 22:44
Combat System Sirridan Development 9 July 14, 2009 08:11
On the pricing of +speed bebo Vanilla 29 May 1, 2009 10:34

All times are GMT +1. The time now is 10:21.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.