# HG changeset patch # User Darkvater # Date 1121462258 0 # Node ID f23dcde246dad9e7722658058c059d7348b3eaac # Parent 899419c9b997d5d453cd13cc7ae28c981b31a0c0 (svn r2584) - Fix: Game no longer asserts when you use the remove-road tool on a town building or industry. diff -r 899419c9b997 -r f23dcde246da road_cmd.c --- a/road_cmd.c Fri Jul 15 20:29:06 2005 +0000 +++ b/road_cmd.c Fri Jul 15 21:17:38 2005 +0000 @@ -139,7 +139,7 @@ TileInfo ti; int32 cost; TileIndex tile; - byte owner; + PlayerID owner; Town *t; /* true if the roadpiece was always removeable, * false if it was a center piece. Affects town ratings drop */ @@ -154,12 +154,11 @@ FindLandscapeHeight(&ti, x, y); tile = ti.tile; - // owner for railraod crossing is stored somewhere else + if (!IsTileType(tile, MP_STREET) && !IsTileType(tile, MP_TUNNELBRIDGE)) return CMD_ERROR; + + // owner for railroad crossing is stored somewhere else // XXX - Fix this so for a given tiletype the owner of the type is in the same variable - if (IsTileType(tile, MP_STREET) && IsLevelCrossing(tile)) { - owner = _m[tile].m3; - } else - owner = GetTileOwner(tile); + owner = IsLevelCrossing(tile) ? _m[tile].m3 : GetTileOwner(tile); if (owner == OWNER_TOWN && _game_mode != GM_EDITOR) { if (IsTileType(tile, MP_TUNNELBRIDGE)) { // index of town is not saved for bridge (no space)