add TrySelectCourse so that SelectCourse can be bound without having to change its protection

This commit is contained in:
AJ Kelly
2012-07-22 17:07:12 -05:00
parent 1fc5fe100e
commit 2edd2b31b5
2 changed files with 146 additions and 137 deletions
+10 -2
View File
@@ -1622,13 +1622,21 @@ public:
static int SelectSong( T* p, lua_State *L )
{
if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); }
else { Song *pS = Luna<Song>::check( L, 1, true ); lua_pushboolean( L, p->SelectSong( pS ) ); }
else
{
Song *pS = Luna<Song>::check( L, 1, true );
lua_pushboolean( L, p->SelectSong( pS ) );
}
return 1;
}
static int SelectCourse( T* p, lua_State *L )
{
if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); }
else { Course *pC = Luna<Course>::check( L, 1, true ); lua_pushboolean( L, p->SelectCourse( pC ) ); }
else
{
Course *pC = Luna<Course>::check( L, 1, true );
lua_pushboolean( L, p->TrySelectCourse( pC ) );
}
return 1;
}