1
0
Fork 0

(svn r14504) -Cleanup: Use the right variable type for tile offsets.

release/0.7
michi_cc 2008-10-20 19:35:48 +00:00
parent 6c35825453
commit 02c99bdf66
3 changed files with 5 additions and 5 deletions

View File

@ -1057,7 +1057,7 @@ static void AiNew_State_BuildPath(Company *c)
ret = AI_DoCommand(tile, DiagDirToRoadBits(ReverseDiagDir(dir1)), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD); ret = AI_DoCommand(tile, DiagDirToRoadBits(ReverseDiagDir(dir1)), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD);
if (CmdSucceeded(ret)) { if (CmdSucceeded(ret)) {
TileIndex offset = TileOffsByDiagDir(dir1); TileIndexDiff offset = TileOffsByDiagDir(dir1);
if (IsTileType(tile + offset, MP_CLEAR) || IsTileType(tile + offset, MP_TREES)) { if (IsTileType(tile + offset, MP_CLEAR) || IsTileType(tile + offset, MP_TREES)) {
ret = AI_DoCommand(tile + offset, AiNew_GetRoadDirection(tile, tile + offset, tile + offset + offset), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD); ret = AI_DoCommand(tile + offset, AiNew_GetRoadDirection(tile, tile + offset, tile + offset + offset), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD);
if (CmdSucceeded(ret)) { if (CmdSucceeded(ret)) {
@ -1069,7 +1069,7 @@ static void AiNew_State_BuildPath(Company *c)
ret = AI_DoCommand(tile, DiagDirToRoadBits(ReverseDiagDir(dir2)), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD); ret = AI_DoCommand(tile, DiagDirToRoadBits(ReverseDiagDir(dir2)), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD);
if (CmdSucceeded(ret)) { if (CmdSucceeded(ret)) {
TileIndex offset = TileOffsByDiagDir(dir2); TileIndexDiff offset = TileOffsByDiagDir(dir2);
if (IsTileType(tile + offset, MP_CLEAR) || IsTileType(tile + offset, MP_TREES)) { if (IsTileType(tile + offset, MP_CLEAR) || IsTileType(tile + offset, MP_TREES)) {
ret = AI_DoCommand(tile + offset, AiNew_GetRoadDirection(tile, tile + offset, tile + offset + offset), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD); ret = AI_DoCommand(tile + offset, AiNew_GetRoadDirection(tile, tile + offset, tile + offset + offset), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD);
if (CmdSucceeded(ret)) { if (CmdSucceeded(ret)) {
@ -1081,7 +1081,7 @@ static void AiNew_State_BuildPath(Company *c)
ret = AI_DoCommand(tile, DiagDirToRoadBits(dir3), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD); ret = AI_DoCommand(tile, DiagDirToRoadBits(dir3), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD);
if (CmdSucceeded(ret)) { if (CmdSucceeded(ret)) {
TileIndex offset = TileOffsByDiagDir(dir3); TileIndexDiff offset = TileOffsByDiagDir(dir3);
if (IsTileType(tile + offset, MP_CLEAR) || IsTileType(tile + offset, MP_TREES)) { if (IsTileType(tile + offset, MP_CLEAR) || IsTileType(tile + offset, MP_TREES)) {
ret = AI_DoCommand(tile + offset, AiNew_GetRoadDirection(tile, tile + offset, tile + offset + offset), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD); ret = AI_DoCommand(tile + offset, AiNew_GetRoadDirection(tile, tile + offset, tile + offset + offset), 0, DC_EXEC | DC_NO_WATER, CMD_BUILD_ROAD);
if (CmdSucceeded(ret)) { if (CmdSucceeded(ret)) {

View File

@ -299,7 +299,7 @@ static inline HouseSpec *GetHouseSpecs(HouseID house_id)
return &_house_specs[house_id]; return &_house_specs[house_id];
} }
TileIndex GetHouseNorthPart(HouseID &house); TileIndexDiff GetHouseNorthPart(HouseID &house);
/** /**
* Check if a TownID is valid. * Check if a TownID is valid.

View File

@ -2026,7 +2026,7 @@ static void DoClearTownHouseHelper(TileIndex tile, Town *t, HouseID house)
* @param house Is changed to the HouseID of the north tile of the same house * @param house Is changed to the HouseID of the north tile of the same house
* @return TileDiff from the tile of the given HouseID to the north tile * @return TileDiff from the tile of the given HouseID to the north tile
*/ */
TileIndex GetHouseNorthPart(HouseID &house) TileIndexDiff GetHouseNorthPart(HouseID &house)
{ {
if (house >= 3) { // house id 0,1,2 MUST be single tile houses, or this code breaks. if (house >= 3) { // house id 0,1,2 MUST be single tile houses, or this code breaks.
if (GetHouseSpecs(house - 1)->building_flags & TILE_SIZE_2x1) { if (GetHouseSpecs(house - 1)->building_flags & TILE_SIZE_2x1) {