return nil for error, not an aribtrary sentinel

This commit is contained in:
Glenn Maynard
2005-04-24 01:25:51 +00:00
parent 902b0e8ac7
commit 50e5e9f597
+1 -1
View File
@@ -431,7 +431,7 @@ class LunaUnlockManager: public Luna<T>
public:
LunaUnlockManager() { LUA->Register( Register ); }
static int FindCode( T* p, lua_State *L ) { CString sName = SArg(1); lua_pushnumber(L, p->FindCode(sName)); return 1; }
static int FindCode( T* p, lua_State *L ) { CString sName = SArg(1); int i = p->FindCode(sName); if( i == -1 ) lua_pushnil(L); else lua_pushnumber(L, i); return 1; }
static int UnlockCode( T* p, lua_State *L ) { int iCode = IArg(1); p->UnlockCode(iCode); return 0; }
static int PreferUnlockCode( T* p, lua_State *L ) { int iCode = IArg(1); p->PreferUnlockCode(iCode); return 0; }