tunnel_map.h
author tron
Sat, 24 Jun 2006 09:12:15 +0000
branch0.4
changeset 10044 ec5486f6f9ef
parent 10032 fcf09abbde96
child 10050 53795ed4cdaf
permissions -rw-r--r--
(svn r5349) -Backport: r5315
-Fix: Prohibit altering a road tile while road works are in progress
This fixes some glitches like "turning" the excavation by adding/removing road bits or removing the road piece
10032
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     1
/* $Id$ */
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     2
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     3
#ifndef TUNNEL_MAP_H
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     4
#define TUNNEL_MAP_H
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     5
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     6
#include "macros.h"
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     7
#include "map.h"
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     8
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
     9
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    10
static inline bool IsTunnel(TileIndex t)
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    11
{
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    12
	assert(IsTileType(t, MP_TUNNELBRIDGE));
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    13
	return !HASBIT(_m[t].m5, 7);
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    14
}
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    15
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    16
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    17
static inline uint GetTunnelDirection(TileIndex t)
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    18
{
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    19
	assert(IsTunnelTile(t));
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    20
	return (uint)GB(_m[t].m5, 0, 2);
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    21
}
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    22
fcf09abbde96 (svn r5115) Move helper functions to where they belong
tron
parents:
diff changeset
    23
#endif