Skip to content

Commit

Permalink
Fixed bugreport:5873 sex changed shouldn't now make exploits regardin…
Browse files Browse the repository at this point in the history
…g item bonuses.

git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16167 54d463be-8e91-2dee-dedb-b68131a5f0ec
  • Loading branch information
rud0lp20 committed May 30, 2012
1 parent c845207 commit d0301ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/char/char.c
Original file line number Diff line number Diff line change
Expand Up @@ -2078,11 +2078,6 @@ int parse_fromlogin(int fd)
else if( class_[i] == JOB_KAGEROU || class_[i] == JOB_OBORO )
class_[i] = (sex ? JOB_KAGEROU : JOB_OBORO);
}
// to avoid any problem with equipment and invalid sex, equipment is unequiped.
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `equip` = '0' WHERE `char_id` = '%d'", inventory_db, char_id[i]) )
Sql_ShowDebug(sql_handle);
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `class`='%d', `weapon`='0', `shield`='0', `head_top`='0', `head_mid`='0', `head_bottom`='0' WHERE `char_id`='%d'", char_db, class_[i], char_id[i]) )
Sql_ShowDebug(sql_handle);

if( guild_id[i] )// If there is a guild, update the guild_member data [Skotlex]
inter_guild_sex_changed(guild_id[i], acc, char_id[i], sex);
Expand Down
4 changes: 4 additions & 0 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -6515,8 +6515,12 @@ ACMD_FUNC(uptime)
*------------------------------------------*/
ACMD_FUNC(changesex)
{
int i;
nullpo_retr(-1, sd);
pc_resetskill(sd,4);
// to avoid any problem with equipment and invalid sex, equipment is unequiped.
for( i=0; i<EQI_MAX; i++ )
if( sd->equip_index[i] >= 0 ) pc_unequipitem(sd, sd->equip_index[i], 3);
chrif_changesex(sd);
return 0;
}
Expand Down
4 changes: 4 additions & 0 deletions src/map/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -9684,10 +9684,14 @@ BUILDIN_FUNC(changebase)
*------------------------------------------*/
BUILDIN_FUNC(changesex)
{
int i;
TBL_PC *sd = NULL;
sd = script_rid2sd(st);

pc_resetskill(sd,4);
// to avoid any problem with equipment and invalid sex, equipment is unequiped.
for( i=0; i<EQI_MAX; i++ )
if( sd->equip_index[i] >= 0 ) pc_unequipitem(sd, sd->equip_index[i], 3);
chrif_changesex(sd);
return 0;
}
Expand Down

0 comments on commit d0301ea

Please sign in to comment.