Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LuaScripting::ExecuteHook(Entity *_entity, const char *_hook, int _value)
- {
- tolua_pushusertype(m_luaState, (void*)_entity, "Entity");
- lua_setglobal(m_luaState, "entity");
- lua_pop(m_luaState, 1);
- if (RunScript(_entity->GetName())) {
- lua_getglobal(m_luaState, _hook);
- if (lua_isfunction(m_luaState, -1)) {
- lua_pushnumber(m_luaState, _value);
- if (!strcmp(_hook, "onMouseOver") || !strcmp(_hook, "onMouseLeave")) {
- lua_call(m_luaState, 0, 0);
- } else {
- lua_call(m_luaState, 1, 0);
- }
- }
- ResetEntityFileGlobals();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement