Changeset 1201

Show
Ignore:
Timestamp:
03/04/2010 09:26:21 AM (6 months ago)
Author:
Paroxysm
Message:

This might fix the crash from here.
http://arcemu.org/forums/index.php?showtopic=21120

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Trunk/src/LuaEngine/LUAEngine.cpp

    r1198 r1201  
    236236void LuaEngine::BeginCall(uint16 fReference) 
    237237{ 
    238         lua_settop(lu,0); //stack should be empty 
    239         lua_rawgeti(lu,LUA_REGISTRYINDEX,fReference); 
    240         if(!lua_isfunction(lu,-1) ) 
    241                 luaL_error(lu,"Attempted to call an invalid function. \n"); 
     238        if(fReference > 1) 
     239        { 
     240                lua_settop(lu,0); //stack should be empty 
     241                lua_rawgeti(lu,LUA_REGISTRYINDEX,fReference); 
     242                if(!lua_isfunction(lu,-1) ) 
     243                        luaL_error(lu,"Attempted to call an invalid function. \n"); 
     244        } 
    242245} 
    243246bool LuaEngine::ExecuteCall(uint8 params, uint8 res)