1
0

Fixed API bindings of cWorld:GetSignLines(), exported cWorld:UseBlockEntity().

This commit is contained in:
madmaxoft
2013-09-15 21:47:56 +02:00
parent a7ad5715f9
commit f8947ce18e
4 changed files with 74 additions and 32 deletions

View File

@@ -660,7 +660,7 @@ static int tolua_cWorld_GetBlockInfo(lua_State * tolua_S)
#ifndef TOLUA_RELEASE
if (self == NULL)
{
tolua_error(tolua_S, "invalid 'self' in function 'SetSignLines' / 'UpdateSign'", NULL);
tolua_error(tolua_S, "invalid 'self' in function 'GetBlockInfo'", NULL);
}
#endif
{
@@ -715,7 +715,7 @@ static int tolua_cWorld_GetBlockTypeMeta(lua_State * tolua_S)
#ifndef TOLUA_RELEASE
if (self == NULL)
{
tolua_error(tolua_S, "invalid 'self' in function 'SetSignLines' / 'UpdateSign'", NULL);
tolua_error(tolua_S, "invalid 'self' in function 'GetBlockTypeMeta'", NULL);
}
#endif
{
@@ -744,6 +744,59 @@ tolua_lerror:
static int tolua_cWorld_GetSignLines(lua_State * tolua_S)
{
// Exported manually, because tolua would generate useless additional parameters (a_Line1 .. a_Line4)
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype (tolua_S, 1, "cWorld", 0, &tolua_err) ||
!tolua_isnumber (tolua_S, 2, 0, &tolua_err) ||
!tolua_isnumber (tolua_S, 3, 0, &tolua_err) ||
!tolua_isnumber (tolua_S, 4, 0, &tolua_err) ||
!tolua_isnoobj (tolua_S, 10, &tolua_err)
)
goto tolua_lerror;
else
#endif
{
cWorld * self = (cWorld *) tolua_tousertype (tolua_S, 1, 0);
int BlockX = (int) tolua_tonumber (tolua_S, 2, 0);
int BlockY = (int) tolua_tonumber (tolua_S, 3, 0);
int BlockZ = (int) tolua_tonumber (tolua_S, 4, 0);
#ifndef TOLUA_RELEASE
if (self == NULL)
{
tolua_error(tolua_S, "invalid 'self' in function 'GetSignLines'", NULL);
}
#endif
{
AString Line1, Line2, Line3, Line4;
bool res = self->GetSignLines(BlockX, BlockY, BlockZ, Line1, Line2, Line3, Line4, Player);
tolua_pushboolean(tolua_S, res ? 1 : 0);
if (res)
{
tolua_pushstring(tolua_S, Line1.c_str());
tolua_pushstring(tolua_S, Line2.c_str());
tolua_pushstring(tolua_S, Line3.c_str());
tolua_pushstring(tolua_S, Line4.c_str());
return 5;
}
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S, "#ferror in function 'GetSignLines'.", &tolua_err);
return 0;
#endif
}
static int tolua_cWorld_SetSignLines(lua_State * tolua_S)
{
// Exported manually, because tolua would generate useless additional return values (a_Line1 .. a_Line4)