From e5dd6f922799a5f741d5e040efcd689f0f5e875b Mon Sep 17 00:00:00 2001 From: michi_cc Date: Mon, 11 Jul 2011 16:32:30 +0000 Subject: (svn r22658) -Feature: [NewGRF] Custom error messages for object callback 0x157. --- src/object_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 9fc5b8ee0..17a053b3d 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -240,7 +240,8 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (callback == CALLBACK_FAILED) { cost.AddCost(CheckBuildableTile(t, 0, allowed_z, false)); } else if (callback != 0) { - return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); + /* The meaning of bit 10 is inverted in the result of this callback. */ + return GetErrorMessageFromLocationCallbackResult(ToggleBit(callback, 10), spec->grf_prop.grffile->grfid, STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); } } } -- cgit v1.2.3-70-g09d2