From b740232ca6fe096fbb429eb04e085e2279ead741 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 26 May 2010 00:07:59 -0500 Subject: [PATCH] rework how the IsGameEnabled() Lua binding works; it now takes a string as a parameter. --- src/GameManager.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/GameManager.cpp b/src/GameManager.cpp index cd15ee070a..327ed81b2e 100644 --- a/src/GameManager.cpp +++ b/src/GameManager.cpp @@ -3130,12 +3130,11 @@ public: } static int IsGameEnabled( T* p, lua_State *L ) { - Game *pGame = Luna::check( L, 1 ); - - lua_pushboolean(L, p->IsGameEnabled( pGame ) ); - - // string version; will clean this up later after finding a good home -aj - //lua_pushbool(L, p->IsGameEnabled( p->StringToGame(SArg(1)) ) ); + const Game *pGame = p->StringToGame(SArg(1)); + if(pGame) + lua_pushboolean(L, p->IsGameEnabled( pGame ) ); + else + lua_pushnil(L); return 1; }