summaryrefslogtreecommitdiff
path: root/src/map/atcommand.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-02-08 21:35:13 -0500
committermekolat <mekolat@users.noreply.github.com>2016-02-08 21:35:13 -0500
commit8b0fab6ad2c3533eb054eb292a630b691502beae (patch)
tree9ccd267676b3c25493c13a4399e475334e8dc90f /src/map/atcommand.cpp
parent71c9e0c06045303c5a0a9fb7c849b76583e449c0 (diff)
parentf889e025cc403ceb6f6276d66fdc367f544a0e82 (diff)
downloadtmwa-8b0fab6ad2c3533eb054eb292a630b691502beae.tar.gz
tmwa-8b0fab6ad2c3533eb054eb292a630b691502beae.tar.bz2
tmwa-8b0fab6ad2c3533eb054eb292a630b691502beae.tar.xz
tmwa-8b0fab6ad2c3533eb054eb292a630b691502beae.zip
Merge pull request #177 from wushin/add-third-gender
Add third gender
Diffstat (limited to 'src/map/atcommand.cpp')
-rw-r--r--src/map/atcommand.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 123a723..f50cddf 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -2348,12 +2348,36 @@ ATCE atcommand_char_change_sex(Session *s, dumb_ptr<map_session_data> sd,
ZString message)
{
CharName character;
+ VString<1> gender;
+ int operation;
- if (!asplit(message, &character))
+ if (!extract(message, record<' ', 1>(&character, &gender)))
+ {
+ clif_displaymessage(s,
+ "Please, enter a char name (usage: @charchangesex <char name> [Gender])."_s);
return ATCE::USAGE;
-
+ }
+ else
{
- chrif_char_ask_name(sd->status_key.account_id, character, 5, HumanTimeDiff());
+ if (sex_from_char(gender.front()) == SEX::FEMALE)
+ {
+ operation = 5;
+ }
+ else if (sex_from_char(gender.front()) == SEX::MALE)
+ {
+ operation = 6;
+ }
+ else if (sex_from_char(gender.front()) == SEX::NEUTRAL)
+ {
+ operation = 7;
+ }
+ else
+ {
+ clif_displaymessage(s,
+ "Please, enter a char name (usage: @charchangesex <char name> [Gender])."_s);
+ return ATCE::USAGE;
+ }
+ chrif_char_ask_name(sd->status_key.account_id, character, operation, HumanTimeDiff());
// type: 5 - changesex
clif_displaymessage(s, "Character name sends to char-server to ask it."_s);
}
@@ -5215,9 +5239,9 @@ Map<XString, AtCommandInfo> atcommand_info =
{"allstats"_s, {"[value]"_s,
60, atcommand_all_stats,
"Adjust all stats by value (or maximum)"_s}},
- {"charchangesex"_s, {"<charname>"_s,
+ {"charchangesex"_s, {"<charname> <sex>"_s,
60, atcommand_char_change_sex,
- "Flip a characters sex and disconnect them"_s}},
+ "Change a characters sex and disconnect them"_s}},
{"block"_s, {"<charname>"_s,
60, atcommand_char_block,
"Permanently block a player's account from the server"_s}},