Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

bug in trunk

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
harry747
Deadly
Deadly
Posts: 135
Joined: Mon Feb 23, 2009 8:57 pm
Location: England

bug in trunk

Post by harry747 »

i have a weird bug related to money: if i save my game and then reload, i suddenly have 10 times as much money as before. right now i'm up to something like 80 Billion (yes, Billion) credits.

i tried without the OXPs, same thing. which means the bug is in oolite. i think i have revision 4422, but the bug was also there in the last few revisions.
MacBook pro, OSX 10.8.5, Xcode 5
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: bug in trunk

Post by Eric Walch »

harry747 wrote:
i have a weird bug related to money: if i save my game and then reload, i suddenly have 10 times as much money as before.
:P :P :P
I didn't notice, but my save game also has 100 times as much credits as the second newest. I think we soon hit the limit of what can be displayed. :wink:
but that means it cant be around for long as it means I only saved twice since the introduction of the bug.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Re: bug in trunk

Post by TGHC »

harry747 wrote:
i have a weird bug related to money: if i save my game and then reload, i suddenly have 10 times as much money as before. right now i'm up to something like 80 Billion (yes, Billion) credits.
Wow that means you had earned 8 billion credits, how the heck did you do that?
Is your real name Warren buffet?
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: bug in trunk

Post by Eric Walch »

harry747 wrote:
i think i have revision 4422, but the bug was also there in the last few revisions.
I checked with the latest nighty (r4412) there the save file was still okay.
Most likely would be:

Code: Select all

r4417 
Several fixes related to credits handling:
* When loading saved games, floating-point credits values go through the same
  clamping logic as JavaScript assignments. This fixes the equivalent problem
  of maximum credits values being treated as 0 on load.
Although on loading things look okay, it goes wrong on saving.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: bug in trunk

Post by Eric Walch »

I just remembered that I had yesterday in the latest log:

Code: Select all

[cheat.tentative] PlayerEntity.m:7652: POSSIBLE CHEAT DETECTED
I already wondered, as I never had edited the save game. But the one below it in my saved game folder was edited. At that time I just thought I opened the wrong file.

I now double checked. This message is now generated on opening such a corrupt file. At least when opening with the latest trunk. When opening the same file with vanilla 1.75 the credits are still okay. :?

EDIT:
The problem are the credits written as <real> in the plist. Older, pre 1.75 Oolite used <integer>. Those files open correct, but the files with the same number written as <real> are multiplied with 10 on opening.
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: bug in trunk

Post by Zireael »

They're multiplied by 10 on 'reading' (see what shows when you choose your saved Commander).

And the bug was not there for r4402. I switched to the newest trunk, flew a nice contract (8000 for flying to a planet 0.2 ly away) and then my jaw fell down, because it showed I had over 2 mln credits.
I decided to check when does it fire up, and went to open the save I just did, and it showed 24 mln credits before I even opened it.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6570
Joined: Wed Feb 28, 2007 7:54 am

Re: bug in trunk

Post by another_commander »

This bug has been fixed in r4427.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Re: bug in trunk

Post by TGHC »

Damn I missed it, I was going to start a dozen new commanders :wink:
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
Post Reply