quality -429496728 honey

The worst monsters in the Hearthlands warp the fabric of space and time..

quality -429496728 honey

Postby hpmons » Wed Dec 02, 2009 11:46 pm

I filled my bucket once and the number was fine, then I filled it from two other hives and it went to -429496728 honey...

From the third hive I also got "Beeswax" with no quality
hpmons
 
Posts: 16
Joined: Tue Nov 24, 2009 9:24 pm

Re: quality -429496728 honey

Postby sabinati » Thu Dec 03, 2009 12:37 am

hey loftar i think the beehives might be bugged
User avatar
sabinati
 
Posts: 15513
Joined: Mon Jul 13, 2009 4:25 am
Location: View active topics

Re: quality -429496728 honey

Postby loftar » Thu Dec 03, 2009 1:19 am

Bugged? No way, I won't believe it! :)

The problem is that I haven't been able to reproduce it at all when debugging them, however. Not even the secondary bug which causes them always to yield LQ honey. :P

Anyway, hpmons, I suggest you throw away that honey (and wax) before using it. Just by crafting with it, you'll get millions of negative LPs.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9045
Joined: Fri Apr 03, 2009 7:05 am

Re: quality -429496728 honey

Postby Lothaudus » Thu Dec 03, 2009 6:01 am

Can't you set the database field as unsigned, forcing it to become a positive number no matter what?

Oh wai... Massive LP gain. Right.
Barry Fletcher Norwin
Lawspeaker of Crossroads - Leader of Codexia - Keeper of the Cheese
http://www.rpgcodex.net
User avatar
Lothaudus
 
Posts: 641
Joined: Fri Oct 23, 2009 12:32 pm
Location: Adelaide, Australia

Re: quality -429496728 honey

Postby sabinati » Thu Dec 03, 2009 6:15 am

can't you just make the honey/wax output an average of the materials used to build it or something?
User avatar
sabinati
 
Posts: 15513
Joined: Mon Jul 13, 2009 4:25 am
Location: View active topics

Re: quality -429496728 honey

Postby loftar » Thu Dec 03, 2009 6:18 am

Well, I did discover the cause of this particular bug, now. For some reason, I had expected that 0.0 / 0.0 would evaluate to 0.0, while in reality it yields NaN. I should've guessed, really. (And ((int)NaN) is -2^31.) This should, thus, not happen anymore.

Now there just remains the bug of the beehives yielding ridiculously LQ products.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9045
Joined: Fri Apr 03, 2009 7:05 am

Re: quality -429496728 honey

Postby sabinati » Thu Dec 03, 2009 7:53 am

where is it even getting the 0.0 values from...?
User avatar
sabinati
 
Posts: 15513
Joined: Mon Jul 13, 2009 4:25 am
Location: View active topics

Re: quality -429496728 honey

Postby Potjeh » Thu Dec 03, 2009 11:34 am

Why are you dividing by zero in the first place? Bad code gnome!
Image Bottleneck
User avatar
Potjeh
 
Posts: 11812
Joined: Fri May 29, 2009 4:03 pm

Re: quality -429496728 honey

Postby loftar » Thu Dec 03, 2009 2:15 pm

Potjeh wrote:Why are you dividing by zero in the first place? Bad code gnome!

I do recall thinking that I just wanted to try and see what happened (that is, verify whether it yielded 0 or NaN). Afterwards, I just may have forgotten about it. :)
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9045
Joined: Fri Apr 03, 2009 7:05 am


Return to Bugs

Who is online

Users browsing this forum: No registered users and 4 guests