Distant-join-stations (in trunk)
Moderator: OpenTTD Developers
It doesn`t ! When I release the mouse it just building the station! Firt I build a station without holdin CTRL, then lets say on 5 tiles away I want to build another station I press CRTL, drag the station and instead of that pop-up it just planting the station!
- Attachments
-
- Finham Transport, 16 Sep 1994.png
- (233.61 KiB) Downloaded 437 times
The rest is confetti!
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
Finished in the sense that it works as a patch - but not that it will be taken into the trunk, apparently. Which would be nice - although I really appreciate the current rush forward in both Ottd and the Patch, it's always nice if the basic features of the two keep up with one another, so that non-expert users can easily make the switch...
Besides, I believe Kaan's wonderful Ottd-builder allows for only one diff at a time in the process, and I already wanted something else in...
Besides, I believe Kaan's wonderful Ottd-builder allows for only one diff at a time in the process, and I already wanted something else in...
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Ok, doesn't seem so easy because I get the following error:
In command.h the following is added
When I try to compile this in MSVC I get:
error C2220: warning treated as error - no 'object' file generated
warning C4091: 'typedef' : ignored on left of 'CommandContainer' when no variable is declared
I also just noticed this error:
2>..\src\station_cmd.cpp(1428) : error C2065: 'distant_join' : undeclared identifier
2>..\src\station_cmd.cpp(1431) : error C2065: 'joinStationIndex' : undeclared identifier
I don't know why I get this error, it seems well defined and there were no errors applying the .diff file with TortoiseSVN.
In command.h the following is added
Code: Select all
Index: src/command.h
===================================================================
--- src/command.h (revision 9840)
+++ src/command.h (working copy)
@@ -200,6 +200,14 @@
int32 DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd);
+typedef struct CommandContainer {
+ TileIndex tile;
+ uint32 p1;
+ uint32 p2;
+ CommandCallback *callback;
+ uint32 cmd;
+};
+
#ifdef ENABLE_NETWORK
error C2220: warning treated as error - no 'object' file generated
warning C4091: 'typedef' : ignored on left of 'CommandContainer' when no variable is declared
I also just noticed this error:
2>..\src\station_cmd.cpp(1428) : error C2065: 'distant_join' : undeclared identifier
2>..\src\station_cmd.cpp(1431) : error C2065: 'joinStationIndex' : undeclared identifier
I don't know why I get this error, it seems well defined and there were no errors applying the .diff file with TortoiseSVN.
The offending code reads, once all the stuff unrelated to the error is removed
Remove the typedef, or use it to define a type.
Code: Select all
typedef struct CommandContainer;
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Removing typedef from the line fixes the error but I still have another error which I couldn't resolve yet. As far as I can see it is definded properly with the lines the patch adds.
Code: Select all
2>..\src\station_cmd.cpp(1428) : error C2065: 'distant_join' : undeclared identifier
2>..\src\station_cmd.cpp(1431) : error C2065: 'joinStationIndex' : undeclared identifier
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
Here's an update to work with the current (10230) trunk.
Regards,
BamBam
Regards,
BamBam
- Attachments
-
- distant_join_stations_r10230.7z
- Win32 executable
- (906.43 KiB) Downloaded 183 times
-
- distant_join_stations_r10230.patch
- (23.46 KiB) Downloaded 218 times
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: Distant-join-stations (rev9840)
Now, this wonderful patch is performing splendidly in ChrisIN, I believe (but then again people would never send bug reports to me, so how could I tell if it didn't?). Does anyone know whether the coding style of this patch is up to standard for inclusion in trunk?
Re: Distant-join-stations (rev9840)
I think this patch goes about things the wrong way. Building a list, and hoping it will be the same on the client and the server from the time the command is issued to the time it is executed is asking for trouble, imho. (Also comments like "Do not laugh " don't inspire too much confidence .)
The way I would do this would be to pass the selected station ID directly to the command. It'll take some re-ordering of p1 and p2, but I think there's still space for it.
The way I would do this would be to pass the selected station ID directly to the command. It'll take some re-ordering of p1 and p2, but I think there's still space for it.
No-one's more important than the earthworm.
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: Distant-join-stations (rev9840)
Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).
Also the station catchment area is either painted wrongfully with the righclick show station catchment patch or it is not working properly. See screenshot.
Also the station catchment area is either painted wrongfully with the righclick show station catchment patch or it is not working properly. See screenshot.
- Attachments
-
- catchment%20area%20bug.png
- (939.16 KiB) Downloaded 199 times
-
- Engineer
- Posts: 28
- Joined: 18 Jun 2007 19:06
Re: Distant-join-stations (rev9840)
As far as I know that catchment area is correctly, the station catchment area is only determined by the two most outher station tiles in a rectangle, so the total catchment area should also always be a rectangle.chrissicom wrote:Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).
Also the station catchment area is either painted wrongfully with the righclick show station catchment patch or it is not working properly. See screenshot.
See also: http://www.tt-forums.net/viewtopic.php?f=33&t=31797
Re: Distant-join-stations (rev9840)
Which is why building a list and hoping no-one else will change it before it gets used is not a good idea.chrissicom wrote:Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).
No-one's more important than the earthworm.
-
- Transport Coordinator
- Posts: 340
- Joined: 06 Feb 2006 23:58
Re: Distant-join-stations (rev9840)
If i remember right, the only way this list could change while you are viewing it,Maedhros wrote:Which is why building a list and hoping no-one else will change it before it gets used is not a good idea.chrissicom wrote:Although the patch works usually really well, there are sometimes little bugs (very seldom) that you are asked wether you'd like to join your station with opponents stations (which results in an error message when you click one of the stations).
is by a coop-player in multiplayer.
Other companies stations should never get into the list,
thus cannot modify the list.
(if opponents stations show up in the list, it is a bug )
btw, if anyone wants to take over, or make a new version, just do it...
i'm busy with keeping copy&paste up to date
Re: Distant-join-stations (rev9840)
Does it currently include a last check after the user has chosen a station with which he wants to join? In coop playing, that would be the moment to check whether the chosen station still exists, and return to the choice screen if it doesn't. Or can anyone confirm the rumour that non-coop opponent's stations appear in the list? Otherwise, this seems a rather likely candidate to go into trunk, seeing how it would increase compatibility with Patch.
Who is online
Users browsing this forum: No registered users and 49 guests