summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-03 19:46:43 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-03 19:46:43 +0000
commit60c165d6caa0ae9f93240f17db02580d30281caa (patch)
treedfb04f4cb47bd549f4276ee6ee776a3c45d4b142 /src/map/pc.c
parentb6cb7738945e8655a4bd94b5f37615058d068638 (diff)
downloadhercules-60c165d6caa0ae9f93240f17db02580d30281caa.tar.gz
hercules-60c165d6caa0ae9f93240f17db02580d30281caa.tar.bz2
hercules-60c165d6caa0ae9f93240f17db02580d30281caa.tar.xz
hercules-60c165d6caa0ae9f93240f17db02580d30281caa.zip
- Removed sd->sex since it's redundant (we can always use sd->status.sex)
- If somehow a player logs out and it's saved with 0 hp, on login his state will be set to dead as well so he can respawn (otherwise that leads to a stuck char) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9398 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 838a1fc23..86b8d5cdb 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -360,10 +360,10 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo
sd->bl.id = account_id;
sd->status.char_id = account_id;
sd->status.char_id = char_id;
+ sd->status.sex = sex;
sd->login_id1 = login_id1;
sd->login_id2 = 0; // at this point, we can not know the value :(
sd->client_tick = client_tick;
- sd->sex = sex;
sd->state.auth = 0;
sd->bl.type = BL_PC;
sd->canlog_tick = gettick();
@@ -576,12 +576,12 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
}
sd->login_id2 = login_id2;
- memcpy(&sd->status, st, sizeof(*st));
- if (sd->status.sex != sd->sex) {
+ if (st->sex != sd->status.sex) {
clif_authfail_fd(sd->fd, 0);
return 1;
}
+ memcpy(&sd->status, st, sizeof(*st));
//Set the map-server used job id. [Skotlex]
i = pc_jobid2mapid(sd->status.class_);
@@ -593,6 +593,7 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
} else
sd->class_ = i;
//Initializations to null/0 unneeded since map_session_data was filled with 0 upon allocation.
+ if(!sd->status.hp) pc_setdead(sd);
sd->state.connect_new = 1;
sd->followtimer = -1; // [MouseJstr]
@@ -5177,7 +5178,7 @@ int pc_readparam(struct map_session_data *sd,int type)
val= pc_mapid2jobid(sd->class_&MAPID_BASEMASK, sd->status.sex);
break;
case SP_SEX:
- val= sd->sex;
+ val= sd->status.sex;
break;
case SP_WEIGHT:
val= sd->weight;
@@ -5312,7 +5313,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
}
break;
case SP_SEX:
- sd->sex = val;
+ sd->status.sex = val;
break;
case SP_WEIGHT:
sd->weight = val;