View Single Post
Old June 30, 2022, 09:51   #9
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,938
PowerWyrm is on a distinguished road
Quote:
Originally Posted by backwardsEric View Post
object_value_real() for the plain gold ring returns 1682025150
In my variant which is based off V, when I put a debug breakpoint on object_value_real() for the One Ring, I get 400100000 from a base power of 20000. If like OP said the V power for the One Ring is 1400000, there will be an overflow in object_value_real() since you get value = a * power * power + b * power with a = 1 and b = 5 and power = 1400000 -> value = 1 960 007 000 000, which turns into 1 501 913 024 after fitting into an int32.

So the bug in indeed in object_power().
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote