From 4806ac05a7ddd4f9c4db79b6df44598c0f260997 Mon Sep 17 00:00:00 2001 From: matthijs Date: Wed, 22 Jun 2005 01:06:04 +0000 Subject: (svn r2471) - Fix: [ 1221249 ] [NPF] Vehicles try to drive into a tunnel entrance from above. --- npf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/npf.c b/npf.c index 330a38835..94ba14b03 100644 --- a/npf.c +++ b/npf.c @@ -461,6 +461,12 @@ void NPFFollowTrack(AyStar* aystar, OpenListNode* current) { } } + /* I can't enter a tunnel entry/exit tile from a tile above the tunnel. Note + * that I can enter the tunnel from a tile below the tunnel entrance. This + * solves the problem of vehicles wanting to drive off a tunnel entrance */ + if (IsTileType(dst_tile, MP_TUNNELBRIDGE) && (_map5[dst_tile] & 0xF0) == 0 && GetTileZ(dst_tile) < GetTileZ(src_tile)) + return; + /* check correct rail type (mono, maglev, etc) * XXX: This now compares with the previous tile, which should not pose a * problem, but it might be nicer to compare with the first tile, or even -- cgit v1.2.3-70-g09d2