push NULL -> nil

This commit is contained in:
Glenn Maynard
2006-11-14 04:15:32 +00:00
parent f61cc91c03
commit bed349a50a
+1 -1
View File
@@ -155,7 +155,7 @@ public:
void T::PushSelf( lua_State *L ) { Luna<B>::PushObject( L, Luna<T>::m_sClassName, this ); } \
static Luna##T registera##T; \
/* Call PushSelf, so we always call the derived Luna<T>::Push. */ \
namespace LuaHelpers { template<> void Push<T*>( lua_State *L, T *const &pObject ) { pObject->PushSelf( L ); } }
namespace LuaHelpers { template<> void Push<T*>( lua_State *L, T *const &pObject ) { if( pObject == NULL ) lua_pushnil(L); else pObject->PushSelf( L ); } }
#define DEFINE_METHOD( method_name, expr ) \
static int method_name( T* p, lua_State *L ) { LuaHelpers::Push( L, p->expr ); return 1; }