bridge_map.c
author tron
Wed, 15 Mar 2006 16:44:50 +0000
changeset 3214 172b409bf612
child 3225 655763f3861c
permissions -rw-r--r--
(svn r3887) Add a function to get the other bridge end when you're at a bridge ramp
/* $Id$ */

#include "stdafx.h"
#include "openttd.h"
#include "bridge_map.h"


TileIndex GetOtherBridgeEnd(TileIndex tile)
{
	TileIndexDiff delta = TileOffsByDir(GetBridgeRampDirection(tile));

	do {
		tile += delta;
	} while (!IsBridgeRamp(tile));

	return tile;
}