summaryrefslogtreecommitdiff
path: root/src/net/ea/playerhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-02 14:05:30 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-02 14:05:30 +0300
commit962f182fcc989ec587282e44f889188ce241ba31 (patch)
treeda100971ec4952d0c56cb404862099c670bcfe0e /src/net/ea/playerhandler.cpp
parent4df121e6dcdf53436f50ce81dd60096ce0138a2c (diff)
downloadmanaverse-962f182fcc989ec587282e44f889188ce241ba31.tar.gz
manaverse-962f182fcc989ec587282e44f889188ce241ba31.tar.bz2
manaverse-962f182fcc989ec587282e44f889188ce241ba31.tar.xz
manaverse-962f182fcc989ec587282e44f889188ce241ba31.zip
Add const to more classes.
Diffstat (limited to 'src/net/ea/playerhandler.cpp')
-rw-r--r--src/net/ea/playerhandler.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index b73782d3e..de687e96b 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -79,7 +79,7 @@ namespace
if (viewport)
viewport->closePopupMenu();
- Net::NpcHandler *handler = Net::getNpcHandler();
+ Net::NpcHandler *const handler = Net::getNpcHandler();
if (handler)
handler->clearDialogs();
if (player_node)
@@ -205,10 +205,10 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg)
if (player_node)
player_node->stopAttack();
- Game *game = Game::instance();
+ Game *const game = Game::instance();
const std::string &currentMapName = game->getCurrentMapName();
- bool sameMap = (currentMapName == mapPath);
+ const bool sameMap = (currentMapName == mapPath);
// Switch the actual map, deleting the previous one if necessary
mapPath = mapPath.substr(0, mapPath.rfind("."));
@@ -219,7 +219,7 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg)
if (player_node)
{
- Map *map = game->getCurrentMap();
+ const Map *const map = game->getCurrentMap();
if (map)
{
if (x >= map->getWidth())
@@ -262,8 +262,8 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg)
void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg)
{
- int type = msg.readInt16();
- int value = msg.readInt32();
+ const int type = msg.readInt16();
+ const int value = msg.readInt32();
if (!player_node)
return;
@@ -280,7 +280,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg)
PlayerInfo::setAttribute(PlayerInfo::HP, value);
if (player_node->isInParty() && Party::getParty(1))
{
- PartyMember *m = Party::getParty(1)
+ PartyMember *const m = Party::getParty(1)
->getMember(player_node->getId());
if (m)
{
@@ -294,7 +294,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg)
if (player_node->isInParty() && Party::getParty(1))
{
- PartyMember *m = Party::getParty(1)->getMember(
+ PartyMember *const m = Party::getParty(1)->getMember(
player_node->getId());
if (m)
{
@@ -453,7 +453,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg)
void PlayerHandler::processPlayerStatUpdate2(Net::MessageIn &msg)
{
- int type = msg.readInt16();
+ const int type = msg.readInt16();
switch (type)
{
case 0x0001:
@@ -467,8 +467,8 @@ void PlayerHandler::processPlayerStatUpdate2(Net::MessageIn &msg)
break;
case 0x0014:
{
- int oldMoney = PlayerInfo::getAttribute(PlayerInfo::MONEY);
- int newMoney = msg.readInt32();
+ const int oldMoney = PlayerInfo::getAttribute(PlayerInfo::MONEY);
+ const int newMoney = msg.readInt32();
if (newMoney > oldMoney)
{
SERVER_NOTICE(strprintf(_("You picked up %s."),
@@ -500,9 +500,9 @@ void PlayerHandler::processPlayerStatUpdate2(Net::MessageIn &msg)
void PlayerHandler::processPlayerStatUpdate3(Net::MessageIn &msg)
{
- int type = msg.readInt32();
- int base = msg.readInt32();
- int bonus = msg.readInt32();
+ const int type = msg.readInt32();
+ const int base = msg.readInt32();
+ const int bonus = msg.readInt32();
PlayerInfo::setStatBase(static_cast<PlayerInfo::Attribute>(
type), base, false);
@@ -514,13 +514,13 @@ void PlayerHandler::processPlayerStatUpdate3(Net::MessageIn &msg)
void PlayerHandler::processPlayerStatUpdate4(Net::MessageIn &msg)
{
- int type = msg.readInt16();
- int ok = msg.readInt8();
- int value = msg.readInt8();
+ const int type = msg.readInt16();
+ const int ok = msg.readInt8();
+ const int value = msg.readInt8();
if (ok != 1)
{
- int oldValue = PlayerInfo::getStatBase(
+ const int oldValue = PlayerInfo::getStatBase(
static_cast<PlayerInfo::Attribute>(type));
int points = PlayerInfo::getAttribute(PlayerInfo::CHAR_POINTS);
points += oldValue - value;
@@ -616,7 +616,7 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg)
void PlayerHandler::processPlayerStatUpdate6(Net::MessageIn &msg)
{
- int type = msg.readInt16();
+ const int type = msg.readInt16();
if (statusWindow)
{
switch (type)
@@ -649,7 +649,7 @@ void PlayerHandler::processPlayerStatUpdate6(Net::MessageIn &msg)
void PlayerHandler::processPlayerArrowMessage(Net::MessageIn &msg)
{
- int type = msg.readInt16();
+ const int type = msg.readInt16();
switch (type)
{