From 003454ccfddb8618a5dd142aef9b4d7ffdd239af Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 26 Sep 2006 09:13:11 +0000 Subject: [PATCH] Deprecated. Note that lua_objlen() doesn't actually return the number of elements in the table. It simply evaluates the new # operator which will return the first integer n such that t[n] is not nil and t[n+1] is nil. Note that this means that this is only useful for tables which have no "holes" and integer indexes (starting at 1). If you really want the table size, you have to walk the whole table (using next() or pairs() in Lua or lua_next() in C). --- stepmania/src/Tween.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stepmania/src/Tween.cpp b/stepmania/src/Tween.cpp index a26e317e4d..bc559da24f 100644 --- a/stepmania/src/Tween.cpp +++ b/stepmania/src/Tween.cpp @@ -93,7 +93,7 @@ ITween *ITween::CreateFromStack( Lua *L, int iStackPos ) if( iType == TWEEN_BEZIER ) { luaL_checktype( L, iStackPos+1, LUA_TTABLE ); - int iArgs = luaL_getn( L, iStackPos+1 ); + int iArgs = lua_objlen( L, iStackPos+1 ); if( iArgs != 4 && iArgs != 8 ) RageException::Throw( "CreateFromStack: table argument must have 4 or 8 entries" );