summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-04-03 10:26:00 +0000
committerDavid Athay <ko2fan@gmail.com>2008-04-03 10:26:00 +0000
commit1bd3c1b9db33cb9dff2570f4224fae73970d5895 (patch)
treecbec38ef22773efa9082e0fec1c0021345a4a92c /src/localplayer.cpp
parent3d9e141447b688c10e46e3dc8033dba26b902e00 (diff)
downloadmana-1bd3c1b9db33cb9dff2570f4224fae73970d5895.tar.gz
mana-1bd3c1b9db33cb9dff2570f4224fae73970d5895.tar.bz2
mana-1bd3c1b9db33cb9dff2570f4224fae73970d5895.tar.xz
mana-1bd3c1b9db33cb9dff2570f4224fae73970d5895.zip
Added right click to invite to guild
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index aa3bb6ba..5cb77692 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -35,6 +35,7 @@
#include "log.h"
#include "net/gameserver/player.h"
+#include "net/chatserver/guild.h"
#include "gui/gui.h"
@@ -128,6 +129,22 @@ bool LocalPlayer::checkInviteRights(const std::string &guildName)
return false;
}
+void LocalPlayer::invite(Being *being)
+{
+ // TODO: Allow user to choose which guild to invite being to
+ // For now, just invite to the first guild you have permissions to invite with
+ std::map<int, Guild*>::iterator itr = mGuilds.begin();
+ std::map<int, Guild*>::iterator itr_end = mGuilds.end();
+ for (; itr != itr_end; ++itr)
+ {
+ if (checkInviteRights(itr->second->getName()))
+ {
+ Net::ChatServer::Guild::invitePlayer(being->getName(), itr->second->getId());
+ return;
+ }
+ }
+}
+
void LocalPlayer::clearInventory()
{
mEquipment->clear();