Проверка на LUA_TLIGHTUSERDATA

This commit is contained in:
Kernell 2015-11-28 16:25:14 +03:00
parent dcf90712d2
commit da44ec13da

View File

@ -217,8 +217,11 @@ void* CLuaFunctionDefinitions::CreateElement( lua_State* pLuaVM, const char* szT
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -253,8 +256,11 @@ void* CLuaFunctionDefinitions::CloneElement( lua_State* pLuaVM, void* pUserData,
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -332,8 +338,11 @@ void* CLuaFunctionDefinitions::GetElementByID( lua_State* pLuaVM, const char* sz
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -348,8 +357,11 @@ void* CLuaFunctionDefinitions::GetElementByIndex( lua_State* pLuaVM, int iIndex
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -365,8 +377,11 @@ void* CLuaFunctionDefinitions::GetElementChild( lua_State* pLuaVM, void* pUserDa
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -447,8 +462,11 @@ void* CLuaFunctionDefinitions::GetElementParent( lua_State* pLuaVM, void* pUserD
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -626,8 +644,11 @@ void* CLuaFunctionDefinitions::GetElementAttachedTo( lua_State* pLuaVM, void* pU
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -642,8 +663,11 @@ void* CLuaFunctionDefinitions::GetElementColShape( lua_State* pLuaVM, void* pUse
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -767,8 +791,11 @@ void* CLuaFunctionDefinitions::GetElementSyncer( lua_State* pLuaVM, void* pUserD
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -1267,7 +1294,12 @@ void* CLuaFunctionDefinitions::GetPlayerFromName( lua_State* pLuaVM, const char*
if( pLuaArguments.Call( pLuaVM, "getPlayerFromName", 1 ) ) if( pLuaArguments.Call( pLuaVM, "getPlayerFromName", 1 ) )
{ {
return CLuaArgument( pLuaVM, -1 ).GetLightUserData(); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData();
}
} }
return NULL; return NULL;
@ -1313,8 +1345,11 @@ void* CLuaFunctionDefinitions::GetRandomPlayer( lua_State* pLuaVM )
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return 0; return 0;
} }
@ -1345,8 +1380,11 @@ void* CLuaFunctionDefinitions::GetPlayerTeam( lua_State* pLuaVM, void* pUserData
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -1561,8 +1599,11 @@ void* CLuaFunctionDefinitions::GetPlayerAccount( lua_State* pLuaVM, void* pUserD
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -1910,8 +1951,11 @@ void* CLuaFunctionDefinitions::CreatePed( lua_State* pLuaVM, int iModelid, const
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -2007,8 +2051,11 @@ void* CLuaFunctionDefinitions::GetPedTarget( lua_State* pLuaVM, void* pUserData
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -2136,8 +2183,11 @@ void* CLuaFunctionDefinitions::GetPedContactElement( lua_State* pLuaVM, void* pU
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -2232,8 +2282,11 @@ void* CLuaFunctionDefinitions::GetPedOccupiedVehicle( lua_State* pLuaVM, void* p
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -2720,8 +2773,11 @@ void* CLuaFunctionDefinitions::CreateVehicle( lua_State* pLuaVM, int model, floa
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -2888,8 +2944,11 @@ void* CLuaFunctionDefinitions::GetVehicleOccupant( lua_State* pLuaVM, void* pUse
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -2918,8 +2977,11 @@ void* CLuaFunctionDefinitions::GetVehicleController( lua_State* pLuaVM, void* pU
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -3178,8 +3240,11 @@ void* CLuaFunctionDefinitions::GetVehicleTowedByVehicle( lua_State* pLuaVM, void
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -3194,8 +3259,11 @@ void* CLuaFunctionDefinitions::GetVehicleTowingVehicle( lua_State* pLuaVM, void*
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -4287,8 +4355,11 @@ void* CLuaFunctionDefinitions::CreateMarker( lua_State* pLuaVM, const Vector3& v
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -4521,8 +4592,11 @@ void* CLuaFunctionDefinitions::CreateBlip( lua_State* pLuaVM, const Vector3& vec
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -4550,8 +4624,11 @@ void* CLuaFunctionDefinitions::CreateBlipAttachedTo( lua_State* pLuaVM, void* pT
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -4759,8 +4836,11 @@ void* CLuaFunctionDefinitions::CreateObject( lua_State* pLuaVM, unsigned short u
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -4876,8 +4956,11 @@ void* CLuaFunctionDefinitions::CreateRadarArea( lua_State* pLuaVM, const Vector2
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5029,8 +5112,11 @@ void* CLuaFunctionDefinitions::CreatePickup( lua_State* pLuaVM, const Vector3& v
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5214,8 +5300,11 @@ void* CLuaFunctionDefinitions::CreateColCircle( lua_State* pLuaVM, const Vector2
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5236,8 +5325,11 @@ void* CLuaFunctionDefinitions::CreateColCuboid( lua_State* pLuaVM, const Vector3
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5256,8 +5348,11 @@ void* CLuaFunctionDefinitions::CreateColSphere( lua_State* pLuaVM, const Vector3
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5276,8 +5371,11 @@ void* CLuaFunctionDefinitions::CreateColRectangle( lua_State* pLuaVM, const Vect
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5301,8 +5399,11 @@ void* CLuaFunctionDefinitions::CreateColPolygon( lua_State* pLuaVM, const vector
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5322,8 +5423,11 @@ void* CLuaFunctionDefinitions::CreateColTube( lua_State* pLuaVM, const Vector3&
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5628,8 +5732,11 @@ void* CLuaFunctionDefinitions::CreateTeam( lua_State* pLuaVM, const char* szTeam
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5644,8 +5751,11 @@ void* CLuaFunctionDefinitions::GetTeamFromName( lua_State* pLuaVM, const char* s
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -5825,8 +5935,11 @@ void* CLuaFunctionDefinitions::CreateWater( lua_State* pLuaVM, Vector3* pV1, Vec
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return false; return false;
} }
@ -7258,12 +7371,17 @@ bool CLuaFunctionDefinitions::ResetMoonSize( lua_State* pLuaVM )
void* CLuaFunctionDefinitions::GetRootElement( lua_State* pLuaVM ) void* CLuaFunctionDefinitions::GetRootElement( lua_State* pLuaVM )
{ {
if( ( new CLuaArguments() )->Call( pLuaVM, "getRootElement", 1 ) ) CLuaArguments pLuaArguments;
if( pLuaArguments.Call( pLuaVM, "getRootElement", 1 ) )
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7284,8 +7402,11 @@ void* CLuaFunctionDefinitions::GetAccount( lua_State* pLuaVM, const char* szName
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7314,8 +7435,11 @@ void* CLuaFunctionDefinitions::GetAccountPlayer( lua_State* pLuaVM, void* pAccou
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7394,8 +7518,11 @@ void* CLuaFunctionDefinitions::AddAccount( lua_State* pLuaVM, const char* szName
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7545,8 +7672,11 @@ void* CLuaFunctionDefinitions::BanPlayer( lua_State* pLuaVM, void* pPlayer, bool
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7571,8 +7701,11 @@ void* CLuaFunctionDefinitions::AddBan( lua_State* pLuaVM, string strIP, string s
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7900,8 +8033,11 @@ void* CLuaFunctionDefinitions::CreateResource( lua_State* pLuaVM, const char* sz
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7918,8 +8054,11 @@ void* CLuaFunctionDefinitions::CopyResource( lua_State* pLuaVM, void* pResource,
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7937,8 +8076,11 @@ void* CLuaFunctionDefinitions::GetResourceRootElement( lua_State* pLuaVM, void*
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -7954,8 +8096,11 @@ void* CLuaFunctionDefinitions::GetResourceMapRootElement( lua_State* pLuaVM, voi
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return false; return false;
} }
@ -7970,8 +8115,11 @@ void* CLuaFunctionDefinitions::GetResourceDynamicElementRoot( lua_State* pLuaVM,
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -8019,8 +8167,11 @@ void* CLuaFunctionDefinitions::GetResourceFromName( lua_State* pLuaVM, const cha
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return NULL; return NULL;
} }
@ -8156,8 +8307,11 @@ void* CLuaFunctionDefinitions::GetThisResource( lua_State* pLuaVM )
{ {
CLuaArgument pLuaArgument( pLuaVM, -1 ); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData(); return pLuaArgument.GetLightUserData();
} }
}
return false; return false;
} }
@ -8427,7 +8581,12 @@ void* CLuaFunctionDefinitions::GetCameraTarget( lua_State* pLuaVM, void* pPlayer
if( pLuaArguments.Call( pLuaVM, "getCameraTarget", 1 ) ) if( pLuaArguments.Call( pLuaVM, "getCameraTarget", 1 ) )
{ {
return ( new CLuaArgument( pLuaVM, -1 ) )->GetLightUserData(); CLuaArgument pLuaArgument( pLuaVM, -1 );
if( pLuaArgument.GetType() == LUA_TLIGHTUSERDATA )
{
return pLuaArgument.GetLightUserData();
}
} }
return NULL; return NULL;