MxSoft
Leave Tibia, Live Life.
Hello everyone today im having an issue when i try to compile, im adding private war system to my server.
Error:
How do i declare it friend function? If someone could help me please because im not so good in C++
Error:
Code:
In file included from raids.h:26:0,
from item.h:29,
from tile.h:23,
from map.h:26,
from creature.h:28,
from player.h:23,
from luascript.cpp:26:
baseevents.h: In static member function 'static int32_t LuaInterface::luaSendToTalkaction(lua_State*)':
baseevents.h:45:25: error: 'virtual LuaInterface& BaseEvents::getInterface()' is protected
virtual LuaInterface& getInterface() = 0;
^
luascript.cpp:9322:56: error: within this context
LuaInterface& interface = g_talkActions->getInterface();
^
C++:
int32_t LuaInterface::luaSendToTalkaction(lua_State* L)
{
LuaInterface& interface = g_talkActions->getInterface();
if(interface.reserveEnv()){
int32_t target = popNumber(L);
int32_t cid = popNumber(L);
lua_State* state = interface.getState();
lua_getglobal(state, "War");
lua_getfield(state, -1, "morte");
lua_pushnumber(state, cid);
lua_pushnumber(state, target);
lua_call(state, 2, 0);
}
return 1;
}