[Server] Remove result from the OnPlayerSendMessage callback

pull/484/head
Koncord 6 years ago
parent efa362031e
commit f1e8569291

@ -198,7 +198,7 @@ public:
{"OnActorDeath", Function<void, unsigned short, const char*>()},
{"OnActorCellChange", Function<void, unsigned short, const char*>()},
{"OnActorTest", Function<void, unsigned short, const char*>()},
{"OnPlayerSendMessage", Function<bool, unsigned short, const char*>()},
{"OnPlayerSendMessage", Function<void, unsigned short, const char*>()},
{"OnPlayerEndCharGen", Function<void, unsigned short>()},
{"OnGUIAction", Function<void, unsigned short, int, const char*>()},
{"OnWorldKillCount", Function<void, unsigned short>()},

@ -21,16 +21,7 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
Script::CallBackReturn<Script::CallbackIdentity("OnPlayerSendMessage")> result = true;
Script::Call<Script::CallbackIdentity("OnPlayerSendMessage")>(result, player.getId(), player.chatMessage.c_str());
if (result)
{
player.chatMessage = player.npc.mName + " (" + std::to_string(player.getId()) + "): "
+ player.chatMessage + "\n";
packet.Send(false);
packet.Send(true);
}
Script::Call<Script::CallbackIdentity("OnPlayerSendMessage")>(player.getId(), player.chatMessage.c_str());
}
};
}

Loading…
Cancel
Save