selling a ship gives me 1 000 000 credits in oolite 1.71.2

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
krombart
Competent
Competent
Posts: 52
Joined: Tue May 20, 2008 9:25 am

selling a ship gives me 1 000 000 credits in oolite 1.71.2

Post by krombart »

As the topic said. That happend as I sold cobra with jameson at lave with the
Realistic Ship Yards installed.

That happened without Realistic Ship Yards installed but with a lot other OXPs loaded.

Reported the bug to the berlios bug tracker.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

I have seen something similar with the current Trunk version, where selling my Hamadryad to buy a Drake (I think it was a Drake) got me a huge lot of cash.

I think its probably an overflow thing, like the last time we saw this bug. I did start looking into it, but I got distracted by 32 and 64 bit floats, while looking to see if there was something funny going on in the type conversion.
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

Cmdr James wrote:
I think its probably an overflow thing, like the last time we saw this bug. I did start looking into it, but I got distracted by 32 and 64 bit floats, while looking to see if there was something funny going on in the type conversion.
just funny that an overflow would hit 1,000,000.00 precisely, I cant recall the largest value for an INT(even though i think this is system specific), while the credits prolly is a Double or Float.
Bounty Scanner
Number 935
krombart
Competent
Competent
Posts: 52
Joined: Tue May 20, 2008 9:25 am

Post by krombart »

Its not exactly 1 000 000 but its alway around this value sometimes 990k or even 1 006 k
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

krombart wrote:
Its not exactly 1 000 000 but its alway around this value sometimes 990k or even 1 006 k
oh clearification, love it.. then i retract my earlier comment...
Bounty Scanner
Number 935
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6629
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

There seems to be an issue when Oolite tries to subtract the ship value credits from your total credits upon buying a ship. This occurs in the trunk version only. The calculation it does is

Code: Select all

credits -= 10 * (price - trade_in);
which is totally wrong. The trade_in value has been already multiplied by 10 before, so we end up overflowing. It should be

Code: Select all

credits -= 10 * price - trade_in;
The fix will go in the trunk in a few minutes.
Edit: I am unable to reproduce this in any way with 1.71.2. The equivalent part of the code for the 1.71.2 tree looks OK to me. I am beginning to suspect a possible issue with the Linux package. This is the second report of 1.71.2 behaving like the trunk version on Linux.
krombart
Competent
Competent
Posts: 52
Joined: Tue May 20, 2008 9:25 am

Post by krombart »

all of this happend in oolite 1.72

sorry for pretending it to be oolite 1.71.2 but I thought the autopackage

oolite-1.71.2.x86.package

would install oolite 1.71.2
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

I’m not sure where that autopackage came from, but I’ll take the easy route and blame Winston. :-)
Post Reply