static inline RoadBits GetOtherRoadBits(TileIndex t, RoadType rt)
{
return GetRoadBits(t, rt == ROADTYPE_ROAD ? ROADTYPE_TRAM ? ROADTYPE_HWAY : ROADTYPE_ROAD );
}
any help would be appreciated

Moderator: OpenTTD Developers
Code: Select all
static inline RoadBits GetOtherRoadBits(TileIndex t, RoadType rt)
{
return GetRoadBits(t, rt == ROADTYPE_ROAD ? ROADTYPE_TRAM : ROADTYPE_ROAD);
}
i've modified the source to allow me to add a third roadtype (ROADTYPE_HWAY and ive added it next to the ROADTYPE_ROAD ? ROADTYPE_TRAM with a '?', is this right? and i've modified the latest trunkYexo wrote:What version are you trying to compile? In trunk that function looks like this:and it compiles fine.Code: Select all
static inline RoadBits GetOtherRoadBits(TileIndex t, RoadType rt) { return GetRoadBits(t, rt == ROADTYPE_ROAD ? ROADTYPE_TRAM : ROADTYPE_ROAD); }
Aha, okmatthew1989 wrote:i've modified the source to allow me to add a third roadtype (ROADTYPE_HWAY and ive added it next to the ROADTYPE_ROAD ? ROADTYPE_TRAM with a '?', is this right? and i've modified the latest trunk
sorry, im just learning C++ and thought learning it would be easier than it has turned out to be
I think otherwise, OTTD is great place to learn about C++ in deep. But you have to know the very basics (=syntax) first.Yexo wrote:Aha, okmatthew1989 wrote:i've modified the source to allow me to add a third roadtype (ROADTYPE_HWAY and ive added it next to the ROADTYPE_ROAD ? ROADTYPE_TRAM with a '?', is this right? and i've modified the latest trunk
sorry, im just learning C++ and thought learning it would be easier than it has turned out to be. The modification you did was not correct, but without more information on your other changes I cannot give you the correct way to change this function. The best advice (yes, you've probably heard it before) is to learn coding first, then try to understand the OpenTTD code. OpenTTD is a pretty big project and without any coding experience it's hard to understand / modify.
The first revision to feature tram support was r9923.matthew1989 wrote:can somebody point me to either a TRAM patch (before it was implemented into trunk) or the revision where trams were first included?
So true.matthew1989 wrote:Played on the European scenarion and decided we DEFINATLY need highways.
Users browsing this forum: No registered users and 4 guests