mirror of https://github.com/OpenTTD/OpenTTD
(svn r8833) -Fix
-Codechange: Split MakeRoadStop() into MakeRoadStop() and MakeDriveThroughRoadStop() for more clarity and less possibilities to use it incorrectrelease/0.6
parent
45b662c679
commit
f716c0b30f
|
@ -1258,8 +1258,12 @@ int32 CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
|
||||||
st->rect.BeforeAddTile(tile, StationRect::ADD_TRY);
|
st->rect.BeforeAddTile(tile, StationRect::ADD_TRY);
|
||||||
|
|
||||||
MakeRoadStop(tile, st->owner, st->index, type ? RoadStop::TRUCK : RoadStop::BUS, is_drive_through, (DiagDirection)p1);
|
RoadStop::Type rs_type = type ? RoadStop::TRUCK : RoadStop::BUS;
|
||||||
if (town_owned_road) SetStopBuiltOnTownRoad(tile);
|
if (is_drive_through) {
|
||||||
|
MakeDriveThroughRoadStop(tile, st->owner, st->index, rs_type, (Axis)p1, town_owned_road);
|
||||||
|
} else {
|
||||||
|
MakeRoadStop(tile, st->owner, st->index, rs_type, (DiagDirection)p1);
|
||||||
|
}
|
||||||
|
|
||||||
UpdateStationVirtCoordDirty(st);
|
UpdateStationVirtCoordDirty(st);
|
||||||
UpdateStationAcceptance(st, false);
|
UpdateStationAcceptance(st, false);
|
||||||
|
|
|
@ -169,11 +169,6 @@ static inline bool GetStopBuiltOnTownRoad(TileIndex t)
|
||||||
return HASBIT(_m[t].m6, 3);
|
return HASBIT(_m[t].m6, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void SetStopBuiltOnTownRoad(TileIndex t)
|
|
||||||
{
|
|
||||||
assert(IsDriveThroughStopTile(t));
|
|
||||||
SETBIT(_m[t].m6, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the direction the road stop entrance points towards.
|
* Gets the direction the road stop entrance points towards.
|
||||||
|
@ -312,13 +307,15 @@ static inline void MakeRailStation(TileIndex t, Owner o, StationID sid, Axis a,
|
||||||
SetRailType(t, rt);
|
SetRailType(t, rt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, bool is_drive_through, DiagDirection d)
|
static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, DiagDirection d)
|
||||||
{
|
{
|
||||||
if (is_drive_through) {
|
MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE : GFX_TRUCK_BASE) + d);
|
||||||
MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE_EXT : GFX_TRUCK_BASE_EXT) + d);
|
}
|
||||||
} else {
|
|
||||||
MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE : GFX_TRUCK_BASE) + d);
|
static inline void MakeDriveThroughRoadStop(TileIndex t, Owner o, StationID sid, RoadStop::Type rst, Axis a, bool on_town_road)
|
||||||
}
|
{
|
||||||
|
MakeStation(t, o, sid, (rst == RoadStop::BUS ? GFX_BUS_BASE_EXT : GFX_TRUCK_BASE_EXT) + a);
|
||||||
|
SB(_m[t].m6, 3, 1, on_town_road);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section)
|
static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section)
|
||||||
|
|
Loading…
Reference in New Issue