Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8271 in orxonox.OLD for trunk/src/lib/script_engine/lunar.h


Ignore:
Timestamp:
Jun 8, 2006, 4:50:50 PM (18 years ago)
Author:
bensch
Message:

merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/script_engine/lunar.h

    r8061 r8271  
    33
    44#include <string>
    5 #include "Script.h"
     5#include <cassert>
     6#include "script.h"
    67
    78#include "luaincl.h"
     9#include "executor/executor_lua.h"
    810
    911
     
    1214      typedef struct { T *pT; } userdataType;
    1315    public:
    14       typedef int (T::*mfp)(lua_State *L);
     16      typedef Executor* mfp;
    1517      typedef struct { const char *name; mfp mfunc; } RegType;
    1618
     
    139141      static int insertObject(Script* script, T* obj, const std::string& name, bool gc=false)
    140142      {
    141         if(script != NULL)
    142           return insertObject(script->getLuaState(), obj, name, gc);
    143 
    144 
     143        assert (script != NULL);
     144        return insertObject(script->getLuaState(), obj, name, gc);
    145145      }
    146146
     
    163163        // get member function from upvalue
    164164        RegType *l = static_cast<RegType*>(lua_touserdata(L, lua_upvalueindex(1)));
    165         return (obj->*(l->mfunc))(L);  // call member function
     165        int value;
     166        (*l->mfunc)(obj, value, L);  // call member function
     167        return value;
    166168      }
    167169
Note: See TracChangeset for help on using the changeset viewer.