Switch
New Member
- Joined
- Oct 27, 2020
- Messages
- 21
- Reaction score
- 3
I'm trying to pass an "NetworkMessage" in creaturescripts, everything works perfect, but when I try to reaload the creaturescripts the server goes down
Follow the code snippet I added
and this is the error that gives...
Follow the code snippet I added
C++:
void CreatureEvent::executeOpcode(Player* player, uint8_t recvbyte, NetworkMessage& msg)
{
//onOpcode(player, recvbyte, msg)
if (!scriptInterface->reserveScriptEnv()) {
std::cout << "[Error - CreatureEvent::executedOpcode] Call stack overflow" << std::endl;
return;
}
ScriptEnvironment* env = scriptInterface->getScriptEnv();
env->setScriptId(scriptId, scriptInterface);
lua_State* L = scriptInterface->getLuaState();
scriptInterface->pushFunction(scriptId);
LuaScriptInterface::pushUserdata<Player>(L, player);
LuaScriptInterface::setMetatable(L, -1, "Player");
lua_pushnumber(L, recvbyte);
LuaScriptInterface::pushUserdata<NetworkMessage>(L, &msg);
LuaScriptInterface::setMetatable(L, -1, "NetworkMessage");
scriptInterface->callVoidFunction(3);
}
and this is the error that gives...
Attachments
-
1606082246815.png31.8 KB · Views: 3 · VirusTotal