summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-18 18:56:46 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-18 19:07:49 +0300
commite85c6227064c905945a4d49a5e11a0078243a1ac (patch)
tree01cab11bccef2c2b47f78d1f32884f6e199db2bd /src/being
parent3c7d4f339c20bc665efa6f6666171f0ca610203b (diff)
downloadManaVerse-e85c6227064c905945a4d49a5e11a0078243a1ac.tar.gz
ManaVerse-e85c6227064c905945a4d49a5e11a0078243a1ac.tar.bz2
ManaVerse-e85c6227064c905945a4d49a5e11a0078243a1ac.tar.xz
ManaVerse-e85c6227064c905945a4d49a5e11a0078243a1ac.zip
add missing const in being classes.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp11
-rw-r--r--src/being/being.h6
-rw-r--r--src/being/localplayer.cpp10
-rw-r--r--src/being/localplayer.h4
-rw-r--r--src/being/playerrelations.cpp2
-rw-r--r--src/being/playerrelations.h2
6 files changed, 19 insertions, 16 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 2e7f6d67b..3f40398a0 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -648,7 +648,8 @@ int Being::getHitEffect(const Being *const attacker,
{
if (attacker)
{
- const ItemInfo *attackerWeapon = attacker->getEquippedWeapon();
+ const ItemInfo *const attackerWeapon
+ = attacker->getEquippedWeapon();
if (attackerWeapon && attacker->getType() == PLAYER)
{
if (type == MISS)
@@ -663,7 +664,7 @@ int Being::getHitEffect(const Being *const attacker,
const BeingInfo *const info = attacker->getInfo();
if (info)
{
- const Attack *atk = info->getAttack(attackId);
+ const Attack *const atk = info->getAttack(attackId);
if (atk)
{
if (type == MISS)
@@ -768,7 +769,7 @@ void Being::handleSkill(Being *const victim, const int damage,
if (this != player_node)
setAction(Being::ATTACK, 1);
- SkillInfo *const skill = skillDialog->getSkill(skillId);
+ const SkillInfo *const skill = skillDialog->getSkill(skillId);
const SkillData *const data = skill
? skill->getData1(skillLevel) : nullptr;
if (data)
@@ -1584,7 +1585,7 @@ void Being::logic()
}
void Being::drawEmotion(Graphics *const graphics, const int offsetX,
- const int offsetY)
+ const int offsetY) const
{
const int px = getPixelX() - offsetX - 16;
const int py = getPixelY() - offsetY - 64 - 32;
@@ -3028,7 +3029,7 @@ void Being::updatePets()
}
void Being::playSfx(const SoundInfo &sound, Being *const being,
- const bool main, const int x, const int y)
+ const bool main, const int x, const int y) const
{
if (being)
{
diff --git a/src/being/being.h b/src/being/being.h
index 8d7db49a5..1668d17eb 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -412,7 +412,7 @@ class Being : public ActorSprite, public ConfigListener
* Draws the emotion picture above the being.
*/
void drawEmotion(Graphics *const graphics, const int offsetX,
- const int offsetY);
+ const int offsetY) const;
uint16_t getSubType() const
{ return mSubType; }
@@ -878,9 +878,9 @@ class Being : public ActorSprite, public ConfigListener
{ mOwner = owner; }
void playSfx(const SoundInfo &sound, Being *const being,
- const bool main, const int x, const int y);
+ const bool main, const int x, const int y) const;
- int getLook()
+ int getLook() const
{ return mLook; }
void setLook(const int look);
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 2179dc318..4d42bc717 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -357,7 +357,8 @@ void LocalPlayer::slowLogic()
if (mTestParticleTime != time && !mTestParticleName.empty())
{
- unsigned long hash = UpdaterWindow::getFileHash(mTestParticleName);
+ const unsigned long hash = UpdaterWindow::getFileHash(
+ mTestParticleName);
if (hash != mTestParticleHash)
{
setTestParticle(mTestParticleName, false);
@@ -803,7 +804,7 @@ void LocalPlayer::nextTile(unsigned char dir A_UNUSED = 0)
if (Net::getNetworkType() != ServerInfo::MANASERV)
#endif
{
- Party *const party = Party::getParty(1);
+ const Party *const party = Party::getParty(1);
if (party)
{
PartyMember *const pm = party->getMember(getName());
@@ -1596,7 +1597,7 @@ void LocalPlayer::optionChanged(const std::string &value)
mTargetOnlyReachable = config.getBoolValue("targetOnlyReachable");
}
-void LocalPlayer::processEvent(Channels channel,
+void LocalPlayer::processEvent(const Channels channel,
const DepricatedEvent &event)
{
if (channel == CHANNEL_ATTRIBUTES)
@@ -4313,7 +4314,8 @@ void LocalPlayer::updateStatus() const
}
}
-void LocalPlayer::setTestParticle(const std::string &fileName, bool updateHash)
+void LocalPlayer::setTestParticle(const std::string &fileName,
+ const bool updateHash)
{
mTestParticleName = fileName;
mTestParticleTime = cur_time;
diff --git a/src/being/localplayer.h b/src/being/localplayer.h
index 5e0cf9ea6..abc4644e2 100644
--- a/src/being/localplayer.h
+++ b/src/being/localplayer.h
@@ -374,7 +374,7 @@ class LocalPlayer final : public Being,
*/
void optionChanged(const std::string &value) override;
- void processEvent(Channels channel,
+ void processEvent(const Channels channel,
const DepricatedEvent &event) override;
/**
@@ -468,7 +468,7 @@ class LocalPlayer final : public Being,
void updateStatus() const;
void setTestParticle(const std::string &fileName,
- bool updateHash = true);
+ const bool updateHash = true);
std::string getInvertDirectionString();
diff --git a/src/being/playerrelations.cpp b/src/being/playerrelations.cpp
index 3ae58a411..7e5807166 100644
--- a/src/being/playerrelations.cpp
+++ b/src/being/playerrelations.cpp
@@ -414,7 +414,7 @@ void PlayerRelationsManager::setDefault(const unsigned int permissions)
signalUpdate("");
}
-void PlayerRelationsManager::ignoreTrade(const std::string &name)
+void PlayerRelationsManager::ignoreTrade(const std::string &name) const
{
if (name.empty())
return;
diff --git a/src/being/playerrelations.h b/src/being/playerrelations.h
index f7e9eba60..5d11b5b25 100644
--- a/src/being/playerrelations.h
+++ b/src/being/playerrelations.h
@@ -240,7 +240,7 @@ class PlayerRelationsManager final
bool getPersistIgnores() const
{ return mPersistIgnores; }
- void ignoreTrade(const std::string &name);
+ void ignoreTrade(const std::string &name) const;
bool isGoodName(Being *const being) const A_WARN_UNUSED;