summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-03-05 18:44:03 +0000
committerDavid Athay <ko2fan@gmail.com>2008-03-05 18:44:03 +0000
commit431a0b17e7eee6b27f98b74f4d073f2131a089dd (patch)
tree446344a335696f12d1eec05a731b094c2d44d991 /src/localplayer.cpp
parent8d2f8756b0e85f14b5d80ec63dc5e5a7f5f5de3d (diff)
downloadmana-client-431a0b17e7eee6b27f98b74f4d073f2131a089dd.tar.gz
mana-client-431a0b17e7eee6b27f98b74f4d073f2131a089dd.tar.bz2
mana-client-431a0b17e7eee6b27f98b74f4d073f2131a089dd.tar.xz
mana-client-431a0b17e7eee6b27f98b74f4d073f2131a089dd.zip
Fixed guild creation.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp62
1 files changed, 6 insertions, 56 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index f581db27..1614b7e7 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -26,6 +26,7 @@
#include "equipment.h"
#include "floor_item.h"
#include "game.h"
+#include "guild.h"
#include "inventory.h"
#include "item.h"
#include "main.h"
@@ -116,65 +117,14 @@ void LocalPlayer::nextStep()
Player::nextStep();
}
-void LocalPlayer::addGuild(short guildId, bool inviteRights)
-{
- Guild *guild = new Guild(guildId, inviteRights);
- mGuilds.push_back(guild);
-}
-
-void LocalPlayer::removeGuild(short guildId)
-{
- std::vector<Guild*>::iterator itr;
- for (itr = mGuilds.begin(); itr != mGuilds.end(); ++itr)
- {
- Guild *guild = (*itr);
- if (guild->getId() == guildId)
- {
- delete guild;
- mGuilds.erase(itr);
- return;
- }
- }
-}
-
-Guild* LocalPlayer::findGuildById(short guildId)
-{
- for (unsigned int i = 0; i < mGuilds.size(); ++i)
- {
- if (mGuilds[i]->getId() == guildId)
- {
- return mGuilds[i];
- }
- }
-
- // not found return NULL
- return NULL;
-}
-
-Guild* LocalPlayer::findGuildByName(const std::string &guildName)
+bool LocalPlayer::checkInviteRights(const std::string &guildName)
{
- for (unsigned int i = 0; i < mGuilds.size(); ++i)
+ Guild *guild = getGuild(guildName);
+ if (guild)
{
- if(mGuilds[i]->getName() == guildName)
- {
- return mGuilds[i];
- }
+ return guild->getInviteRights();
}
-
- // Not found, so return NULL
- return NULL;
-}
-short LocalPlayer::getNumberOfGuilds()
-{
- return mGuilds.size();
-}
-
-bool LocalPlayer::checkInviteRights(const std::string &guildName)
-{
- Guild *guild = findGuildByName(guildName);
- if(guild)
- return guild->getInviteRights();
return false;
}
@@ -446,7 +396,7 @@ void LocalPlayer::lowerAttribute(size_t attr)
const std::string& LocalPlayer::getSkillName(int skill)
{
static const std::string skills[CHAR_SKILL_NB + 1] =
- {
+ {
_("Unarmed"), // CHAR_SKILL_WEAPON_NONE
_("Knife"), // CHAR_SKILL_WEAPON_KNIFE
_("Sword"), // CHAR_SKILL_WEAPON_SWORD