The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: 1993matias on April 15, 2019, 11:27:48 AM

Title: Cannot purchase trams or aircraft
Post by: 1993matias on April 15, 2019, 11:27:48 AM
Latest nightly build (364b448), when I open the electrified tram depot (new or existing) I can't buy a tram. All available trams appear, but nothing happens when I click on them. Happens both in my savegame but also the demo game. The track is tram track and electrification is tram DC catenary.

EDIT: It seems only to be the trams that have this issue. Bus and train depots are working completely normal
Title: Re: Can't buy trams
Post by: jamespetts on April 15, 2019, 03:25:14 PM
Thank you for the report. I am afraid that I am away this week and do not have access to the computer where I can do significant debugging works. I will look into this when I get back home next week. My apologies for the difficulties in the meantime.
Title: Re: Can't buy trams
Post by: RESTRICTED ACCOUNT on April 15, 2019, 03:59:35 PM
I confirmed that I can not buy tram with the latest build.
But with the April 12th build I can buy the tram correctly.

EDIT:
It seems to be triggered by this commit (https://github.com/jamespetts/simutrans-extended/commit/364b44895c6afd2371f3e93ef63739f725ea96dc) because it works correctly when revert this commit.
Title: Re: Can't buy trams
Post by: 1993matias on April 15, 2019, 04:01:22 PM
Quote from: jamespetts on April 15, 2019, 03:25:14 PM
Thank you for the report. I am afraid that I am away this week and do not have access to the computer where I can do significant debugging works. I will look into this when I get back home next week. My apologies for the difficulties in the meantime.
Thanks for your hard work - don't worry about it

Ranran: Would you be able to share (or point me at) the April 12th build? In case James takes some days off :)
Title: Re: Can't buy trams
Post by: RESTRICTED ACCOUNT on April 15, 2019, 04:15:56 PM
Quote from: 1993matias on April 15, 2019, 04:01:22 PMRanran: Would you be able to share (or point me at) the April 12th build? In case James takes some days off
Yes, here it is.  ;)
https://drive.google.com/open?id=17l02V91ToIvZpDz1MgW4CHazZEnS5ZFI

Note: It is a 64-bit version for windows
Title: Re: Can't buy trams
Post by: passengerpigeon on April 18, 2019, 10:39:08 PM
I have noticed this problem with both trams and aircraft since a few days ago. Buses work fine, as do trains; not sure about ships or narrow gauge.
Title: [BUG] Cannot buy planes from air depot.
Post by: DrSuperGood on April 19, 2019, 05:39:40 AM
Logged into the server game. Wanted to buy some planes at an air depot to increase service frequency of a busy line. Cannot.

Literally I cannot buy the planes. Clicking the buttons does absolutely nothing. The depot way type does have sufficient axel load and so does the runway it is connected to. Does not matter which airplane one clicks, none of them get brought. All aircraft show green bars under which usually indicates that purchase is possible.

This only effects air depots. I can buy cars, trains and boats at the appropriate depots no problem, just not aircraft.
Title: Re: Can't buy trams
Post by: DrSuperGood on April 19, 2019, 05:42:03 AM
Also run into the cannot buy aircraft problem. I am guessing it is related to this.
Title: Re: Can't buy trams
Post by: Jando on April 19, 2019, 12:18:16 PM
I'm seeing the same with narrow gauge trains.
Title: Re: Cannot purchase trams or aircraft
Post by: jamespetts on April 19, 2019, 12:50:23 PM
I have merged the topic with that relating to aircraft. As noted above, I am currently away from home and without access to the computer on which I have my debugger set up, so I am afraid that I will not be able to look into this until next week; my apologies. If anyone would like to look into a fix for this in the meantime, that would be most helpful.
Title: Re: Cannot purchase trams or aircraft
Post by: RESTRICTED ACCOUNT on April 19, 2019, 09:46:55 PM
I suppose the problem is here as I mentioned before.
https://github.com/jamespetts/simutrans-extended/commit/364b44895c6afd2371f3e93ef63739f725ea96dc

There are the following 8 types of depot in simutrans (corresponded to waytype):
obj_t::strassendepot;
obj_t::bahndepot;
obj_t::schiffdepot;
obj_t::monoraildepot;
obj_t::maglevdepot;
obj_t::tramdepot;
obj_t::narrowgaugedepot;
obj_t::airdepot;

German to Eng: strassen = road, bahn = train, schiff = ship.

However, it was rewritten to specify only 3 types - strassendepot, bahndepot and schiffdepot in that commit (https://github.com/jamespetts/simutrans-extended/commit/364b44895c6afd2371f3e93ef63739f725ea96dc). So it seems that an error has occurred in other depots. That is, monorail, maglev, tram, narrow gauge, and air.
I do not know if this is done to avoid something. Any reason?
Title: Re: Cannot purchase trams or aircraft
Post by: jamespetts on April 19, 2019, 10:02:35 PM
Thank you for this. I think that I have been able to fix this without using the debugger - I should be grateful if anyone could test with to-morrow's nightly build.

This code change was implemented to make this function deterministic: the equivalent function for signalboxes had caused the serious loss of synchronisation problem that took 6 months to solve recently and which was solved by implementing an equivalent change. I had not remembered that each specific waytype had its own depot type (I seem to remember copying this from some code that also specified only these types of depots, although I cannot now recall where), and must have assumed that these depot types were sufficient to cover others (which I must have assumed were implemented as subtypes).

I am not sure why the code for building vehicles from a depot has to search for the depot on a particular piece of ground in order to complete the building, but I have now modified the function to specify each depot type separately, so hopefully this should work (testing with trams seems to confirm this).
Title: Re: Cannot purchase trams or aircraft
Post by: DrSuperGood on April 20, 2019, 05:10:41 PM
Seems fixed now.
Title: Re: Cannot purchase trams or aircraft
Post by: jamespetts on April 20, 2019, 05:33:26 PM
Splendid, thank you for confirming.