summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/atcommands.txt6
-rw-r--r--src/map/atcommand.c13
2 files changed, 19 insertions, 0 deletions
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index 139295973..0b4dce579 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -1059,6 +1059,12 @@ Changes the gender attached to the player's account.
---------------------------------------
+@changecharsex
+
+Changes the gender attached to the player's character.
+
+---------------------------------------
+
@marry <player 1> <player 2>
@divorce <player>
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 22969606d..b472694c4 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6750,6 +6750,18 @@ ACMD(changesex)
return true;
}
+ACMD(changecharsex)
+{
+ int i;
+
+ pc->resetskill(sd, PCRESETSKILL_CHSEX);
+ // to avoid any problem with equipment and invalid sex, equipment is unequipped.
+ for (i=0; i<EQI_MAX; i++)
+ if (sd->equip_index[i] >= 0) pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
+ chrif->changesex(sd, false);
+ return true;
+}
+
/*================================================
* @mute - Mutes a player for a set amount of time
*------------------------------------------------*/
@@ -10115,6 +10127,7 @@ static void atcommand_basecommands(void)
ACMD_DEF(clearweather),
ACMD_DEF(uptime),
ACMD_DEF(changesex),
+ ACMD_DEF(changecharsex),
ACMD_DEF(mute),
ACMD_DEF(refresh),
ACMD_DEF(refreshall),