Minor shopping bug

Make all T-Engine/ToME 4 bug reports here

Moderator: Moderator

Post Reply
Message
Author
Vanguard
Higher
Posts: 68
Joined: Wed Jun 02, 2010 8:51 am

Minor shopping bug

#1 Post by Vanguard »

While playing today, I had exactly 5.00 gold and tried to buy something for 5.00 gold and it wouldn't let me. I sold a potion for 0.30 and it let me make the purchase after that. What I assume is happening is the game is checking to see if you have more gold than the price of the object, rather than as much or more.

Canderel
Sher'Tul
Posts: 1252
Joined: Mon Nov 24, 2003 2:31 pm
Location: South Africa

Re: Minor shopping bug

#2 Post by Canderel »

There are 2 possibilities...

1) As you said, > is used instead of >=.
2) You only had 4.999 gold... dunno if the game knows the fractions smaller than 2 decimals.

Shoob
Reaper
Posts: 1534
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: Minor shopping bug

#3 Post by Shoob »

Canderel wrote:2) You only had 4.999 gold... dunno if the game knows the fractions smaller than 2 decimals.
take for example selling ammo, if you do that I can guarantee that you will have a strange amount of gold (unless you use it to round it to a nice figure first).
Oliphant am I, and I never lie.

registeringislame
Halfling
Posts: 85
Joined: Sun May 23, 2010 5:25 am

Re: Minor shopping bug

#4 Post by registeringislame »

Floats should never be used for money. Is this a lua issue? I'd've thought lua has integers, but hell, perl doesn't.

tomeaddict
Low Yeek
Posts: 5
Joined: Tue Jun 08, 2010 8:17 pm

Re: Minor shopping bug

#5 Post by tomeaddict »

I've had this happen---3 gold and tried to buy a lesser healing for 3. managed to raise 0.1 and my return met with consumer success.

registeringislame
Halfling
Posts: 85
Joined: Sun May 23, 2010 5:25 am

Re: Minor shopping bug

#6 Post by registeringislame »

Actually I looked into it, and the lua people only seem to use doubles. Apparently this is "never a problem."

lovely.

Post Reply