From 60c165d6caa0ae9f93240f17db02580d30281caa Mon Sep 17 00:00:00 2001 From: skotlex Date: Sun, 3 Dec 2006 19:46:43 +0000 Subject: - 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 --- src/map/chrif.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/map/chrif.c') diff --git a/src/map/chrif.c b/src/map/chrif.c index b11640b74..95b874327 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -863,13 +863,8 @@ int chrif_changedsex(int fd) sd = map_id2sd(acc); if (acc > 0) { if (sd != NULL && sd->status.sex != sex) { - if (sd->status.sex == 0) { - sd->status.sex = 1; - sd->sex = 1; - } else if (sd->status.sex == 1) { - sd->status.sex = 0; - sd->sex = 0; - } + sd->status.sex = !sd->status.sex; + // to avoid any problem with equipment and invalid sex, equipment is unequiped. for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].nameid && sd->status.inventory[i].equip) -- cgit v1.2.3-70-g09d2