summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-30 02:05:40 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-01 03:11:26 +0300
commita39f63cdfa5ce15b22f294a8bb1db3a036ce462d (patch)
tree4de71bde947cae0cf5d3196cd97e82f5bc537c5c /src/net/tmwa
parent02ec4369acfbf261236631e20dbb76131e7889f8 (diff)
downloadplus-a39f63cdfa5ce15b22f294a8bb1db3a036ce462d.tar.gz
plus-a39f63cdfa5ce15b22f294a8bb1db3a036ce462d.tar.bz2
plus-a39f63cdfa5ce15b22f294a8bb1db3a036ce462d.tar.xz
plus-a39f63cdfa5ce15b22f294a8bb1db3a036ce462d.zip
One part of fixes after auto checking.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/charserverhandler.cpp21
-rw-r--r--src/net/tmwa/chathandler.cpp9
-rw-r--r--src/net/tmwa/generalhandler.cpp3
3 files changed, 15 insertions, 18 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 6202070bb..04274a70b 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -174,13 +174,14 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
LocalPlayer *tempPlayer = new LocalPlayer(msg.readInt32(), 0);
tempPlayer->setGender(token.sex);
- character->data.mAttributes[EXP] = msg.readInt32();
- character->data.mAttributes[MONEY] = msg.readInt32();
- character->data.mStats[JOB].exp = msg.readInt32();
+ PlayerInfoBackend &data = character->data;
+ data.mAttributes[EXP] = msg.readInt32();
+ data.mAttributes[MONEY] = msg.readInt32();
+ data.mStats[JOB].exp = msg.readInt32();
int temp = msg.readInt32();
- character->data.mStats[JOB].base = temp;
- character->data.mStats[JOB].mod = temp;
+ data.mStats[JOB].base = temp;
+ data.mStats[JOB].mod = temp;
int shoes = msg.readInt16();
int gloves = msg.readInt16();
@@ -192,10 +193,10 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
msg.readInt32(); // manner
msg.readInt16(); // character points left
- character->data.mAttributes[HP] = msg.readInt16();
- character->data.mAttributes[MAX_HP] = msg.readInt16();
- character->data.mAttributes[MP] = msg.readInt16();
- character->data.mAttributes[MAX_MP] = msg.readInt16();
+ data.mAttributes[HP] = msg.readInt16();
+ data.mAttributes[MAX_HP] = msg.readInt16();
+ data.mAttributes[MP] = msg.readInt16();
+ data.mAttributes[MAX_MP] = msg.readInt16();
msg.readInt16(); // speed
tempPlayer->setSubtype(msg.readInt16()); // class (used for race)
@@ -203,7 +204,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
Uint16 weapon = msg.readInt16(); // server not used it. may be need use?
tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true);
- character->data.mAttributes[LEVEL] = msg.readInt16();
+ data.mAttributes[LEVEL] = msg.readInt16();
msg.readInt16(); // skill point
int bottomClothes = msg.readInt16();
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 7830d3a81..2323631cb 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -172,12 +172,9 @@ void ChatHandler::sendRaw(const std::string &args)
line = line.substr(pos + 1);
pos = line.find(" ");
}
- if (outMsg)
- {
- if (line != "")
- processRaw(*outMsg, line);
- delete outMsg;
- }
+ if (line != "")
+ processRaw(*outMsg, line);
+ delete outMsg;
}
void ChatHandler::processRaw(MessageOut &outMsg, std::string &line)
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 8f2f25d6d..8188efc73 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -215,8 +215,7 @@ void GeneralHandler::reloadPartially()
void GeneralHandler::unload()
{
- if (mNetwork)
- mNetwork->clearHandlers();
+ clearHandlers();
}
void GeneralHandler::flushNetwork()