Changeset - r1903:f39feacd3de9
[Not reviewed]
master
0 1 0
tron - 19 years ago 2005-06-04 12:14:51
tron@openttd.org
(svn r2409) Missed one _map_owner -> IsTileOwner()
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rail_cmd.c
Show inline comments
 
@@ -317,49 +317,49 @@ int32 CmdBuildSingleRail(int x, int y, u
 

	
 
					if (flags & DC_EXEC) {
 
						SetTileOwner(tile, _current_player);
 
						_map3_lo[tile] &= ~0x0F;
 
						_map3_lo[tile] |= p1;
 
						_map5[tile] = (m5 & 0xC7) | 0x20; // railroad under bridge
 
					}
 
					break;
 

	
 
				case 0x20: // rail already there
 
					return_cmd_error(STR_1007_ALREADY_BUILT);
 

	
 
				default:
 
					// Get detailed error message
 
					return DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
			}
 
			break;
 

	
 
		case MP_RAILWAY:
 
			if (!CheckTrackCombination(m5, rail_bit, flags) ||
 
					!EnsureNoVehicle(tile)) {
 
				return CMD_ERROR;
 
			}
 
			if (m5 & RAIL_TYPE_SPECIAL ||
 
					_map_owner[tile] != _current_player ||
 
					!IsTileOwner(tile, _current_player) ||
 
					(_map3_lo[tile] & 0xFU) != p1) {
 
				// Get detailed error message
 
				return DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
			}
 

	
 
			ret = CheckRailSlope(tileh, rail_bit, m5 & RAIL_BIT_MASK, tile);
 
			if (CmdFailed(ret)) return ret;
 
			cost += ret;
 

	
 
			if (flags & DC_EXEC) {
 
				_map2[tile] &= ~RAIL_MAP2LO_GROUND_MASK; // Bare land
 
				_map5[tile] = m5 | rail_bit;
 
			}
 
			break;
 

	
 
		case MP_STREET:
 
			if (!_valid_tileh_slopes[3][tileh]) // prevent certain slopes
 
				return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
 
			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
 

	
 
			if ((m5 & 0xF0) == 0 && ( // normal road?
 
						(rail_bit == 1 && m5 == 0x05) ||
 
						(rail_bit == 2 && m5 == 0x0A) // correct direction?
 
					)) {
0 comments (0 inline, 0 general)