From cfd6875c864570e85a8ac64f3abd8d65f2d47e05 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 8 Feb 2014 13:35:08 +0100 Subject: [PATCH] Fixed cWorld:TryGetHeight() API. --- src/Bindings/ManualBindings.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index d476a3156..841ec5cf2 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -906,8 +906,12 @@ static int tolua_cWorld_TryGetHeight(lua_State * tolua_S) { int Height = 0; bool res = self->TryGetHeight(BlockX, BlockZ, Height); - tolua_pushnumber(tolua_S, Height); tolua_pushboolean(tolua_S, res ? 1 : 0); + if (res) + { + tolua_pushnumber(tolua_S, Height); + return 2; + } } } return 1;