diff options
author | Darkvater <darkvater@openttd.org> | 2006-04-26 21:48:22 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-04-26 21:48:22 +0000 |
commit | feefbbbf06eacaf857f6cd7cdbb8216b8e6b97dc (patch) | |
tree | d896d9ae3cc601842ad7147e66fd7eb298394619 /road_cmd.c | |
parent | 939dd7d2bf4da9adfe71e0a4294dc419663d0b0e (diff) | |
download | openttd-feefbbbf06eacaf857f6cd7cdbb8216b8e6b97dc.tar.xz |
(svn r4586) - Codechange: Recursive commands that rely on _error_message to handle success/failure can fail if a recursive call fails but doesn't set the error message, thus resulting in an old, possibly erroneous being used (see FS#130 prior to r4585). Now properly reset the global variable _error_message in these cases.
Diffstat (limited to 'road_cmd.c')
-rw-r--r-- | road_cmd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/road_cmd.c b/road_cmd.c index 5c8589da3..66ee4521a 100644 --- a/road_cmd.c +++ b/road_cmd.c @@ -474,6 +474,7 @@ int32 CmdBuildLongRoad(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2) ret = DoCommand(tile, bits, 0, flags, CMD_BUILD_ROAD); if (CmdFailed(ret)) { if (_error_message != STR_1007_ALREADY_BUILT) return CMD_ERROR; + _error_message = INVALID_STRING_ID; } else { cost += ret; } |