Bug in 1.73, very probably - SOLVED!

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

Moderators: winston, another_commander, Getafix

User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

Bug in 1.73, very probably - SOLVED!

Post by Lestradae »

Since short before 1.73 came out, the buying and selling of stations has stopped working as intended, too :?

This code here:

Code: Select all

this.playerBoughtEquipment = function(equipment)
        {
        switch(equipment)
                {
                case "EQ_PLAYERSTATION_AAA":
                        {
                        missionVariables.playerstation_AAA = 1;
                        mission.runMissionScreen("RockHermit_transaction", null, null, "playerrockhermit", null);
                        player.ship.removeEquipment("EQ_PLAYERSTATION_AAA");
                        return;
                        }
... no longer seems to work as intended.

The equipment is bought - this shows in the log - and the mission variable gets set - the bought station shows in the mission list where it should - but the text under "RockHermit_transaction" doesn't show and the model of the role "playerrockhermit" suddenly doesn't show either.

Cobble a test oxp together and look for yourself. It neither works in official 1.73 nor in the current trunk (SVN 2369 or somesuch)

:(

L
Last edited by Lestradae on Wed Sep 02, 2009 10:01 pm, edited 1 time in total.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Can you please tell us which is the last revision where this works as intended?
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post by Lestradae »

I think SVN 2330.

Why? Shouldn't it?

It worked as intended whenever I tested it while developing it ... suddenly noticed that it is no longer working :?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

I assume it goes wrong because of these lines in the source:

Code: Select all

   [self doScriptEvent:@"playerBoughtEquipment" withArgument:key];
   [self setGuiToEquipShipScreen:0]; // show any change due to playerBoughtEquipment
It was never anticipated that a missionscreen was shown in the middle of buying things. And somewhere in the last 50 revisions the second line is added to make sure the equipment screen was correctly updated after this handler. It probably also needs a check to see if we are still on the equip screen
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

Can you guys really please change this back or alter it somehow for 1.73.1 so that my code does work again?

It would make the buying & selling of stations impossible if it stayed as it is, and ruin two weeks of work :( :( :(

:?:

L
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I would guess that's Kak's work on the equipment screen due to the bug I reported on Berlios about the screen not getting updated properly when you purchase weapon items that should only be available singly (the Captured Thargons in that case).

That also pops up a mission screen after you purchase it (to get around said bug by navigating away from the screen to force a refresh before next equipment can be bought), so I'll check that too.
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: ..

Post by Eric Walch »

Lestradae wrote:
Can you guys really please change this back or alter it somehow for 1.73.1 so that my code does work again?

It would make the buying & selling of stations impossible if it stayed as it is, and ruin two weeks of work :( :( :(
You could always call your stuff with a 0 second timer. That way it will be processed after the equipment screen. But changing the lines into:

Code: Select all

			[self doScriptEvent:@"playerBoughtEquipment" withArgument:key];
			if (gui_screen == GUI_SCREEN_EQUIP_SHIP) [self setGuiToEquipShipScreen:0]; // show any change due to playerBoughtEquipment
should do the trick. At least normal buying is not hindered by it as I just tested.
But I one of the other members should do the update as my update would only go to trunk.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

I'm committing this fix to maintenance and trunk in the next 10 minutes.
Thanks Eric!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Kaksy, you are late! :-)

Done.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

A_C: fair enough.

Thargoid: yep, right guess.

I'm afraid I got myself a huge dose of stupid when I was looking at that particular event. I did manage to correct the pre-existing bugs, but... well, the rest is history alredy. :(

I'm still kicking myself about crippling the laser purchases. :(
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
zevans
---- E L I T E ----
---- E L I T E ----
Posts: 332
Joined: Mon Jul 06, 2009 11:12 pm
Location: Uncharted backwaters of the unfashionable end of the western spiral arm

Post by zevans »

I'm still amazed and seriously impressed there's only one blooper... usually as soon as you announce anything close to a release, 20 new things come to light!
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

:)

Post by Lestradae »

Hey guys, that's what I call a quick fix! :D

Will update my trunk test version now and look if it works again.

Thanks very much! :D

@Kaks: Come on, in the meantime even I can imagine how easy it is to overlook things like that - there must be trillions of ways to put an error into such a complex program as Oolite is and only a few options that work as intended ...

Cheers everyone 8)

L
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post by Lestradae »

I tried everything with the newest trunk revision and A_C's fix has worked - very happy to report that now the buying and selling of player stations does work as intended again! :D

I hope this will make it into 1.73.1 as a bugfix, yes? :shock:

Cheers & thanks

L
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

It's already in the 1.73.1 branch (aka 'maintenance'). That's why Eric said
But I one of the other members should do the update as my update would only go to trunk.
z & L: well, there's already 6 separate bugfixes ready for 1.73.1 - 4 other things that we didn't quite manage to sort out for 1.73, and maybe we'll be able to correct one or two more bugs. But I'm so not doing any last minute commit this time!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: ...

Post by another_commander »

Lestradae wrote:
I tried everything with the newest trunk revision and A_C's fix has worked [snip]
To be clear: It's Eric's fix, not mine.
Post Reply