Changeset - r14599:72f46f3f8d2b
[Not reviewed]
master
0 1 0
alberth - 15 years ago 2010-02-21 17:02:28
alberth@openttd.org
(svn r19186) -Codechange: Remove use of _error_message from CmdLevelLand().
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/terraform_cmd.cpp
Show inline comments
 
@@ -376,7 +376,6 @@ CommandCost CmdLevelLand(TileIndex tile,
 

	
 
	/* Check range of destination height */
 
	if (h > MAX_TILE_HEIGHT) return_cmd_error((oldh == 0) ? STR_ERROR_ALREADY_AT_SEA_LEVEL : STR_ERROR_TOO_HIGH);
 
	if (p2 == 0) _error_message = STR_ERROR_ALREADY_LEVELLED;
 

	
 
	Money money = GetAvailableMoneyForCommand();
 
	CommandCost cost(EXPENSES_CONSTRUCTION);
 
@@ -402,5 +401,10 @@ CommandCost CmdLevelLand(TileIndex tile,
 
		}
 
	}
 

	
 
	return (cost.GetCost() == 0) ? CMD_ERROR : cost;
 
	if (cost.GetCost() == 0) {
 
		if (p2 != 0) return CMD_ERROR;
 
		cost.MakeError(STR_ERROR_ALREADY_LEVELLED);
 
		cost.SetGlobalErrorMessage();
 
	}
 
	return cost;
 
}
0 comments (0 inline, 0 general)