summaryrefslogtreecommitdiff
path: root/src/map/party.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-05-18 17:37:33 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-05-18 18:49:39 -0700
commitac359e696f162090840dab488a6ef4981d35bbda (patch)
tree2ee04de23428bba264d1e39c80d5f50180d1b555 /src/map/party.cpp
parentfd00d50574064db9edfcccc4286ed8f1b55b185a (diff)
downloadtmwa-ac359e696f162090840dab488a6ef4981d35bbda.tar.gz
tmwa-ac359e696f162090840dab488a6ef4981d35bbda.tar.bz2
tmwa-ac359e696f162090840dab488a6ef4981d35bbda.tar.xz
tmwa-ac359e696f162090840dab488a6ef4981d35bbda.zip
Tweak a little memory management in char-server
Diffstat (limited to 'src/map/party.cpp')
-rw-r--r--src/map/party.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/map/party.cpp b/src/map/party.cpp
index f737601..594fdf7 100644
--- a/src/map/party.cpp
+++ b/src/map/party.cpp
@@ -126,14 +126,14 @@ int party_request_info(int party_id)
static
int party_check_member(struct party *p)
{
- int i;
- struct map_session_data *sd;
-
nullpo_ret(p);
- for (i = 0; i < fd_max; i++)
+ for (int i = 0; i < fd_max; i++)
{
- if (session[i] && (sd = (struct map_session_data *)session[i]->session_data) && sd->state.auth)
+ if (!session[i])
+ continue;
+ map_session_data *sd = static_cast<map_session_data *>(session[i]->session_data.get());
+ if (sd && sd->state.auth)
{
if (sd->status.party_id == p->party_id)
{
@@ -167,11 +167,12 @@ int party_check_member(struct party *p)
// 情報所得失敗(そのIDのキャラを全部未所属にする)
int party_recv_noinfo(int party_id)
{
- int i;
- struct map_session_data *sd;
- for (i = 0; i < fd_max; i++)
+ for (int i = 0; i < fd_max; i++)
{
- if (session[i] && (sd = (struct map_session_data *)session[i]->session_data) && sd->state.auth)
+ if (!session[i])
+ continue;
+ map_session_data *sd = static_cast<map_session_data *>(session[i]->session_data.get());
+ if (sd && sd->state.auth)
{
if (sd->status.party_id == party_id)
sd->status.party_id = 0;