MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / SlashCmdHandler

Method SlashCmdHandler

src/bzfs/lua/SlashCmd.cpp:58–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57
58SlashCmdHandler::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
75SlashCmdHandler::~SlashCmdHandler() {

Callers

nothing calls this directly

Calls 1

luaL_refFunction · 0.50

Tested by

no test coverage detected