summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-23 18:51:10 +0100
committerErich Eckner <git@eckner.net>2018-11-23 18:51:10 +0100
commit48b7e3ee64e9adf99962a0624f27f4304bc7c8ba (patch)
treebda9b553e23db63754c2d6a8b9d4db686c8b9b18
parent761993b659ff7617cf02e08ce4d118b0c21911e7 (diff)
downloadarchlinuxewe-48b7e3ee64e9adf99962a0624f27f4304bc7c8ba.tar.xz
openttd-git: some progress in sloped-stations
-rw-r--r--openttd-git/PKGBUILD2
-rw-r--r--openttd-git/sloped-stations.patch22
2 files changed, 20 insertions, 4 deletions
diff --git a/openttd-git/PKGBUILD b/openttd-git/PKGBUILD
index a8632a498..cb26a4798 100644
--- a/openttd-git/PKGBUILD
+++ b/openttd-git/PKGBUILD
@@ -39,7 +39,7 @@ source=(
)
sha512sums=('SKIP'
'1b591b07d5f15c49b5ce0e961398e8cc7db99854724f7da6e23ccdff885cbbf3bcc707c42dc20cc4d6928d1b1e7559fd6e64828f31585da7f8e1d5fac5cbc4a2'
- 'b9995b78a2cdffbc9a6decd4c3aefcc4d9c821d1420ddf91aa372938bec316573dd85eb9827bdcbad15e6476c30ec8d5217fd5ade614cb4db5b8f9c890040245'
+ '29b5a06e5c80fe1851a596e62d4d8b68107cd4f16631c695be196d5cee8f2bbda5864a75eeb2d37834c03e861248611911224969b0e0e2a2338a37e24ea7c1a2'
'45e03d0a749179de6e71f12a70df40a5324aa0055612f373fe91023ac5d2a6ac0fbb471b8e290b5812bcf35e5084077ea2f12106aaf0cd976727f019c71c5268')
pkgver() {
diff --git a/openttd-git/sloped-stations.patch b/openttd-git/sloped-stations.patch
index ee682db6b..e5bc8888f 100644
--- a/openttd-git/sloped-stations.patch
+++ b/openttd-git/sloped-stations.patch
@@ -1,3 +1,19 @@
+diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp
+index 56b97875fc..90934e43c9 100644
+--- a/src/ground_vehicle.hpp
++++ b/src/ground_vehicle.hpp
+@@ -221,8 +221,9 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> {
+ * without any shift */
+ this->z_pos += HasBit(this->gv_flags, GVF_GOINGUP_BIT) ? d : -d;
+ }
+-
+- assert(this->z_pos == GetSlopePixelZ(this->x_pos, this->y_pos));
++if (this->z_pos != GetSlopePixelZ(this->x_pos, this->y_pos)) {
++ fprintf(stderr,"ASSERT: %d != %d\n",this->z_pos, GetSlopePixelZ(this->x_pos, this->y_pos));
++}
+ }
+
+ /**
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index a0fd968cc6..980e2fb42b 100644
--- a/src/rail_cmd.cpp
@@ -94,7 +110,7 @@ index 5251a53923..ce9ac81518 100644
+
#endif /* ROAD_TYPE_H */
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
-index 16f135df25..726205fd8b 100644
+index 16f135df25..bb46a2f541 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -53,6 +53,7 @@
@@ -285,10 +301,10 @@ index 16f135df25..726205fd8b 100644
static int GetSlopePixelZ_Station(TileIndex tile, uint x, uint y)
{
+ /* this code makes vehicles and trains follow the slope on sloped stations */
-+ if (IsRailStation(tile)) {
++ if (IsRailStation(tile) || IsRoadStopTile(tile) && !IsStandardRoadStopTile(tile)) {
+ int z;
+ Slope tileh = GetTilePixelSlope(tile, &z);
-+ Axis axis = GetRailStationAxis(tile);
++ Axis axis = IsRailStation(tile)?GetRailStationAxis(tile):DiagDirToAxis(GetRoadStopDir(tile));
+
+ z += 8*ApplyFoundationToSlope(GetRailFoundation(tileh,AxisToTrackBits(axis)), &tileh);
+ return z + GetPartialPixelZ(x & 0xF, y & 0xF, tileh);