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

@ -1,6 +1,6 @@
/* /*
** Lua binding: AllToLua ** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 09/15/13 20:52:09. ** Generated automatically by tolua++-1.0.92 on 09/15/13 21:24:51.
*/ */
#ifndef __cplusplus #ifndef __cplusplus
@ -12599,51 +12599,40 @@ static int tolua_AllToLua_cWorld_DoExplosionAt00(lua_State* tolua_S)
} }
#endif //#ifndef TOLUA_DISABLE #endif //#ifndef TOLUA_DISABLE
/* method: GetSignLines of class cWorld */ /* method: UseBlockEntity of class cWorld */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_GetSignLines00 #ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_UseBlockEntity00
static int tolua_AllToLua_cWorld_GetSignLines00(lua_State* tolua_S) static int tolua_AllToLua_cWorld_UseBlockEntity00(lua_State* tolua_S)
{ {
#ifndef TOLUA_RELEASE #ifndef TOLUA_RELEASE
tolua_Error tolua_err; tolua_Error tolua_err;
if ( if (
!tolua_isusertype(tolua_S,1,"cWorld",0,&tolua_err) || !tolua_isusertype(tolua_S,1,"cWorld",0,&tolua_err) ||
!tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isusertype(tolua_S,2,"cPlayer",0,&tolua_err) ||
!tolua_isnumber(tolua_S,3,0,&tolua_err) || !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
!tolua_isnumber(tolua_S,4,0,&tolua_err) || !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
!tolua_iscppstring(tolua_S,5,0,&tolua_err) || !tolua_isnumber(tolua_S,5,0,&tolua_err) ||
!tolua_iscppstring(tolua_S,6,0,&tolua_err) || !tolua_isnoobj(tolua_S,6,&tolua_err)
!tolua_iscppstring(tolua_S,7,0,&tolua_err) ||
!tolua_iscppstring(tolua_S,8,0,&tolua_err) ||
!tolua_isnoobj(tolua_S,9,&tolua_err)
) )
goto tolua_lerror; goto tolua_lerror;
else else
#endif #endif
{ {
cWorld* self = (cWorld*) tolua_tousertype(tolua_S,1,0); cWorld* self = (cWorld*) tolua_tousertype(tolua_S,1,0);
int a_BlockX = ((int) tolua_tonumber(tolua_S,2,0)); cPlayer* a_Player = ((cPlayer*) tolua_tousertype(tolua_S,2,0));
int a_BlockY = ((int) tolua_tonumber(tolua_S,3,0)); int a_BlockX = ((int) tolua_tonumber(tolua_S,3,0));
int a_BlockZ = ((int) tolua_tonumber(tolua_S,4,0)); int a_BlockY = ((int) tolua_tonumber(tolua_S,4,0));
AString a_Line1 = ((AString) tolua_tocppstring(tolua_S,5,0)); int a_BlockZ = ((int) tolua_tonumber(tolua_S,5,0));
AString a_Line2 = ((AString) tolua_tocppstring(tolua_S,6,0));
AString a_Line3 = ((AString) tolua_tocppstring(tolua_S,7,0));
AString a_Line4 = ((AString) tolua_tocppstring(tolua_S,8,0));
#ifndef TOLUA_RELEASE #ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetSignLines'", NULL); if (!self) tolua_error(tolua_S,"invalid 'self' in function 'UseBlockEntity'", NULL);
#endif #endif
{ {
bool tolua_ret = (bool) self->GetSignLines(a_BlockX,a_BlockY,a_BlockZ,a_Line1,a_Line2,a_Line3,a_Line4); self->UseBlockEntity(a_Player,a_BlockX,a_BlockY,a_BlockZ);
tolua_pushboolean(tolua_S,(bool)tolua_ret);
tolua_pushcppstring(tolua_S,(const char*)a_Line1);
tolua_pushcppstring(tolua_S,(const char*)a_Line2);
tolua_pushcppstring(tolua_S,(const char*)a_Line3);
tolua_pushcppstring(tolua_S,(const char*)a_Line4);
} }
} }
return 5; return 0;
#ifndef TOLUA_RELEASE #ifndef TOLUA_RELEASE
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'GetSignLines'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'UseBlockEntity'.",&tolua_err);
return 0; return 0;
#endif #endif
} }
@ -29956,7 +29945,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"WakeUpSimulators",tolua_AllToLua_cWorld_WakeUpSimulators00); tolua_function(tolua_S,"WakeUpSimulators",tolua_AllToLua_cWorld_WakeUpSimulators00);
tolua_function(tolua_S,"WakeUpSimulatorsInArea",tolua_AllToLua_cWorld_WakeUpSimulatorsInArea00); tolua_function(tolua_S,"WakeUpSimulatorsInArea",tolua_AllToLua_cWorld_WakeUpSimulatorsInArea00);
tolua_function(tolua_S,"DoExplosionAt",tolua_AllToLua_cWorld_DoExplosionAt00); tolua_function(tolua_S,"DoExplosionAt",tolua_AllToLua_cWorld_DoExplosionAt00);
tolua_function(tolua_S,"GetSignLines",tolua_AllToLua_cWorld_GetSignLines00); tolua_function(tolua_S,"UseBlockEntity",tolua_AllToLua_cWorld_UseBlockEntity00);
tolua_function(tolua_S,"GrowTree",tolua_AllToLua_cWorld_GrowTree00); tolua_function(tolua_S,"GrowTree",tolua_AllToLua_cWorld_GrowTree00);
tolua_function(tolua_S,"GrowTreeFromSapling",tolua_AllToLua_cWorld_GrowTreeFromSapling00); tolua_function(tolua_S,"GrowTreeFromSapling",tolua_AllToLua_cWorld_GrowTreeFromSapling00);
tolua_function(tolua_S,"GrowTreeByBiome",tolua_AllToLua_cWorld_GrowTreeByBiome00); tolua_function(tolua_S,"GrowTreeByBiome",tolua_AllToLua_cWorld_GrowTreeByBiome00);

View File

@ -1,6 +1,6 @@
/* /*
** Lua binding: AllToLua ** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 09/15/13 20:52:10. ** Generated automatically by tolua++-1.0.92 on 09/15/13 21:24:52.
*/ */
/* Exported function */ /* Exported function */

View File

@ -660,7 +660,7 @@ static int tolua_cWorld_GetBlockInfo(lua_State * tolua_S)
#ifndef TOLUA_RELEASE #ifndef TOLUA_RELEASE
if (self == NULL) 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 #endif
{ {
@ -715,7 +715,7 @@ static int tolua_cWorld_GetBlockTypeMeta(lua_State * tolua_S)
#ifndef TOLUA_RELEASE #ifndef TOLUA_RELEASE
if (self == NULL) 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 #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) static int tolua_cWorld_SetSignLines(lua_State * tolua_S)
{ {
// Exported manually, because tolua would generate useless additional return values (a_Line1 .. a_Line4) // Exported manually, because tolua would generate useless additional return values (a_Line1 .. a_Line4)

View File

@ -443,10 +443,10 @@ public:
bool DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurnaceCallback & a_Callback); // Exported in ManualBindings.cpp bool DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurnaceCallback & a_Callback); // Exported in ManualBindings.cpp
/// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found /// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found
bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // tolua_export bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // Exported in ManualBindings.cpp
/// a_Player is using block entity at [x, y, z], handle that: /// a_Player is using block entity at [x, y, z], handle that:
void UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) {m_ChunkMap->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ); } void UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) {m_ChunkMap->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ); } // tolua_export
/// Calls the callback for the chunk specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback /// Calls the callback for the chunk specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback
bool DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback & a_Callback); bool DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback & a_Callback);