///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
| 1239 | ////////////////////////////////////////////////////////////////////// |
| 1240 | ////////////////////////////////////////////////////////////////////// |
| 1241 | HSCRIPTFUNCTION CScriptSystem::GetFunctionPtr(const char *sFuncName) |
| 1242 | { |
| 1243 | _GUARD_STACK(m_pLS); |
| 1244 | HSCRIPTFUNCTION func; |
| 1245 | lua_getglobal(m_pLS, sFuncName); |
| 1246 | if (lua_isnil(m_pLS, -1) ||(!lua_isfunction(m_pLS, -1))) |
| 1247 | { |
| 1248 | lua_pop(m_pLS, 1); |
| 1249 | return NULL; |
| 1250 | } |
| 1251 | func = (HSCRIPTFUNCTION)lua_ref(m_pLS, 0); |
| 1252 | |
| 1253 | return func; |
| 1254 | } |
| 1255 | |
| 1256 | ////////////////////////////////////////////////////////////////////// |
| 1257 | ////////////////////////////////////////////////////////////////////// |
no test coverage detected