| 56 | |
| 57 | |
| 58 | SlashCmdHandler::SlashCmdHandler(const std::string& c, const std::string& h) |
| 59 | : cmd(c) |
| 60 | , helpTxt(h) |
| 61 | , luaRef(LUA_NOREF) { |
| 62 | slashHandlers[cmd] = this; |
| 63 | |
| 64 | lua_State* L = LuaServer::GetL(); |
| 65 | if (L == NULL) { |
| 66 | return; |
| 67 | } |
| 68 | if (!lua_isfunction(L, -1)) { |
| 69 | return; |
| 70 | } |
| 71 | luaRef = luaL_ref(L, LUA_REGISTRYINDEX); |
| 72 | } |
| 73 | |
| 74 | |
| 75 | SlashCmdHandler::~SlashCmdHandler() { |
nothing calls this directly
no test coverage detected