summaryrefslogtreecommitdiff
path: root/src/net/ea/partyhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-10-17 22:07:24 +0300
committerAndrei Karas <akaras@inbox.ru>2011-10-17 22:07:24 +0300
commitd14bb7a27ee23cc83b3af1db2f1976eaaa55d78a (patch)
tree5f128768c66436eefd70632f02889607596609d4 /src/net/ea/partyhandler.cpp
parentf1e92aca00a4859047e83fab76220767b9a2f814 (diff)
parente93e6beb456d105987da3190c2a80847b6900081 (diff)
downloadplus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.tar.gz
plus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.tar.bz2
plus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.tar.xz
plus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.zip
Merge branch 'master' into strippedstripped1.1.10.16
Conflicts: data/fonts/mplus-1p-bold.ttf data/fonts/mplus-1p-regular.ttf
Diffstat (limited to 'src/net/ea/partyhandler.cpp')
-rw-r--r--src/net/ea/partyhandler.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 36e192ce8..35cc77fbf 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -40,7 +40,7 @@ namespace Ea
PartyTab *partyTab = 0;
Party *taParty = 0;
-PartyHandler::PartyHandler():
+PartyHandler::PartyHandler() :
mShareExp(PARTY_SHARE_UNKNOWN),
mShareItems(PARTY_SHARE_UNKNOWN)
{
@@ -344,7 +344,10 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg)
int id = msg.readInt32();
std::string nick = msg.readString(24);
msg.readInt8(); // fail
- if (player_node && id == player_node->getId())
+ if (!player_node)
+ return;
+
+ if (id == player_node->getId())
{
if (Ea::taParty)
{
@@ -431,21 +434,18 @@ void PartyHandler::processPartyMessage(Net::MessageIn &msg)
int id = msg.readInt32();
std::string chatMsg = msg.readString(msgLength);
- if (Ea::taParty)
+ if (Ea::taParty && Ea::partyTab)
{
PartyMember *member = Ea::taParty->getMember(id);
- if (Ea::partyTab)
+ if (member)
{
- if (member)
- {
- Ea::partyTab->chatLog(member->getName(), chatMsg);
- }
- else
- {
- Ea::partyTab->chatLog(strprintf(
- _("An unknown member tried to say: %s"),
- chatMsg.c_str()), BY_SERVER);
- }
+ Ea::partyTab->chatLog(member->getName(), chatMsg);
+ }
+ else
+ {
+ Ea::partyTab->chatLog(strprintf(
+ _("An unknown member tried to say: %s"),
+ chatMsg.c_str()), BY_SERVER);
}
}
}