Clean-up some unnecessary CHECKVAL templates.

This commit is contained in:
Patman64
2014-08-02 02:21:07 -04:00
parent 57153d6c47
commit 49698169c7
2 changed files with 29 additions and 98 deletions

View File

@@ -20,6 +20,13 @@
#include "World.h"
#include "HookMgr.h"
extern "C"
{
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
};
#ifdef TRINITY
struct ItemTemplate;
#else
@@ -163,7 +170,10 @@ public:
// Checks
template<typename T> static T CHECKVAL(lua_State* L, int narg);
template<typename T> static T CHECKVAL(lua_State* L, int narg, T def);
template<typename T> static T CHECKVAL(lua_State* L, int narg, T def)
{
return lua_isnoneornil(L, narg) ? def : CHECKVAL<T>(L, narg);
}
template<typename T> static T* CHECKOBJ(lua_State* L, int narg, bool error = true)
{
return ElunaTemplate<T>::check(L, narg, error);