1
0

Added cEntity's gravity to the Lua API.

This commit is contained in:
madmaxoft 2013-09-03 10:20:56 +02:00
parent 2c5e566fe7
commit 4c24781a62
3 changed files with 73 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 09/03/13 08:38:38.
** Generated automatically by tolua++-1.0.92 on 09/03/13 10:19:58.
*/
#ifndef __cplusplus
@ -6654,6 +6654,71 @@ tolua_lerror:
}
#endif //#ifndef TOLUA_DISABLE
/* method: GetGravity of class cEntity */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetGravity00
static int tolua_AllToLua_cEntity_GetGravity00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetGravity'", NULL);
#endif
{
float tolua_ret = (float) self->GetGravity();
tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'GetGravity'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: SetGravity of class cEntity */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_SetGravity00
static int tolua_AllToLua_cEntity_SetGravity00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) ||
!tolua_isnumber(tolua_S,2,0,&tolua_err) ||
!tolua_isnoobj(tolua_S,3,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0);
float a_Gravity = ((float) tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetGravity'", NULL);
#endif
{
self->SetGravity(a_Gravity);
}
}
return 0;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'SetGravity'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: GetRawDamageAgainst of class cEntity */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetRawDamageAgainst00
static int tolua_AllToLua_cEntity_GetRawDamageAgainst00(lua_State* tolua_S)
@ -29460,6 +29525,8 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cEntity_TakeDamage00);
tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cEntity_TakeDamage01);
tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cEntity_TakeDamage02);
tolua_function(tolua_S,"GetGravity",tolua_AllToLua_cEntity_GetGravity00);
tolua_function(tolua_S,"SetGravity",tolua_AllToLua_cEntity_SetGravity00);
tolua_function(tolua_S,"GetRawDamageAgainst",tolua_AllToLua_cEntity_GetRawDamageAgainst00);
tolua_function(tolua_S,"GetArmorCoverAgainst",tolua_AllToLua_cEntity_GetArmorCoverAgainst00);
tolua_function(tolua_S,"GetKnockbackAmountAgainst",tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00);

View File

@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 09/03/13 08:38:39.
** Generated automatically by tolua++-1.0.92 on 09/03/13 10:19:59.
*/
/* Exported function */

View File

@ -201,6 +201,10 @@ public:
/// Makes this entity take the specified damage. The values are packed into a TDI, knockback calculated, then sent through DoTakeDamage()
void TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount);
float GetGravity(void) const { return m_Gravity; }
void SetGravity(float a_Gravity) { m_Gravity = a_Gravity; }
// tolua_end
/// Makes this entity take damage specified in the a_TDI. The TDI is sent through plugins first, then applied