diff -r 1ac8aac92385 -r e79cd19772dd src/clear_cmd.cpp --- a/src/clear_cmd.cpp Wed Jun 13 12:05:56 2007 +0000 +++ b/src/clear_cmd.cpp Tue Jun 19 07:21:01 2007 +0000 @@ -37,7 +37,7 @@ int modheight_count; int tile_table_count; - int32 cost; + CommandCost cost; TileIndex *tile_table; TerraformerHeightMod *modheight; @@ -98,7 +98,7 @@ static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode) { int r; - int32 ret; + CommandCost ret; assert(tile < MapSize()); @@ -233,7 +233,7 @@ * @param p2 direction; eg up or down * @return error or cost of terraforming */ -int32 CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) +CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { TerraformerState ts; TileIndex t; @@ -358,14 +358,16 @@ * @param p2 unused * @return error or cost of terraforming */ -int32 CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) +CommandCost CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { int size_x, size_y; int ex; int ey; int sx, sy; uint h, curh; - int32 ret, cost, money; + int32 money; + CommandCost ret; + CommandCost cost; if (p1 >= MapSize()) return CMD_ERROR; @@ -419,9 +421,9 @@ * @param p2 unused * @return error of cost of operation */ -int32 CmdPurchaseTile(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) +CommandCost CmdPurchaseTile(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { - int32 cost; + CommandCost cost; SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); @@ -443,7 +445,7 @@ } -static int32 ClearTile_Clear(TileIndex tile, byte flags) +static CommandCost ClearTile_Clear(TileIndex tile, byte flags) { static const int32 clear_price_table[] = { _eco->GetPrice(CEconomy::CLEAR_1), @@ -454,7 +456,7 @@ _eco->GetPrice(CEconomy::PURCHASE_LAND), _eco->GetPrice(CEconomy::CLEAR_2), // XXX unused? }; - int32 price; + CommandCost price; if (IsClearGround(tile, CLEAR_GRASS) && GetClearDensity(tile) == 0) { price = 0; @@ -475,7 +477,7 @@ * @param p2 unused * @return error or cost of operation */ -int32 CmdSellTile(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) +CommandCost CmdSellTile(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);