Changed CheckEnum to use lua_isnoneornil so that enum args can be made properly optional. Changed PlayMusicPart to allow nil for optional args so optional args would be independent.

This commit is contained in:
Kyzentun
2014-07-19 15:20:02 -06:00
parent 305e80a08b
commit 4c97ff64a0
2 changed files with 19 additions and 21 deletions
+1 -3
View File
@@ -6,9 +6,7 @@
int CheckEnum( lua_State *L, LuaReference &table, int iPos, int iInvalid, const char *szType, bool bAllowInvalid, bool bAllowAnything )
{
luaL_checkany( L, iPos );
if( lua_isnil(L, iPos) )
if( lua_isnoneornil(L, iPos) )
{
if( bAllowInvalid )
return iInvalid;