proper error messages, and return nil on error
This commit is contained in:
@@ -636,11 +636,18 @@ namespace
|
|||||||
int ResolvePath( lua_State *L )
|
int ResolvePath( lua_State *L )
|
||||||
{
|
{
|
||||||
RString sPath( SArg(1) );
|
RString sPath( SArg(1) );
|
||||||
|
int iLevel = IArg(2);
|
||||||
|
luaL_where( L, iLevel );
|
||||||
|
RString sWhere = lua_tostring( L, -1 );
|
||||||
|
if( sWhere.size() > 2 && sWhere.substr(sWhere.size()-2, 2) == ": " )
|
||||||
|
sWhere = sWhere.substr( 0, sWhere.size()-2 ); // remove trailing ": "
|
||||||
|
|
||||||
LUA->YieldLua();
|
LUA->YieldLua();
|
||||||
ActorUtil::ResolvePath( sPath, "" );
|
bool bRet = ActorUtil::ResolvePath( sPath, sWhere );
|
||||||
LUA->UnyieldLua();
|
LUA->UnyieldLua();
|
||||||
|
|
||||||
|
if( !bRet )
|
||||||
|
return 0;
|
||||||
LuaHelpers::Push( L, sPath );
|
LuaHelpers::Push( L, sPath );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user