diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/chat-server/chathandler.cpp | 7 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2008-04-03 David Athay <kofan@gmail.com> + + * src/chat-server/chathandler.cpp: Restricted who can be invited to + guilds. + 2008-04-02 David Athay <ko2fan@gmail.com> * src/chat-server/chathandler.cpp: Fix accepting guild invites. diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp index 0ec9ba39..3d2d8742 100644 --- a/src/chat-server/chathandler.cpp +++ b/src/chat-server/chathandler.cpp @@ -621,8 +621,11 @@ ChatHandler::handleGuildInvitation(ChatClient &client, MessageIn &msg) if (invitedClient && guild) { - // check permissions of inviter - if (guild->checkLeader(client.characterName)) + // check permissions of inviter, and that they arent inviting themself, + // and arent someone already in the guild + if (guild->checkLeader(client.characterName) && + (client.characterName != character) && + !guild->checkInGuild(character)) { // send the name of the inviter and the name of the guild // that the character has been invited to join |