diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/chrif.cpp | 7 | ||||
-rw-r--r-- | src/map/pc.cpp | 3 | ||||
-rw-r--r-- | src/map/script-fun.cpp | 15 |
3 files changed, 4 insertions, 21 deletions
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 24369ed..3ffeaf2 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -568,15 +568,14 @@ void chrif_changedsex(Session *, const Packet_Fixed<0x2b0d>& fixed) { if (sd->status.inventory[i].nameid && bool(sd->status.inventory[i].equip)) - pc_unequipitem(sd, i, CalcStatus::NOW); + pc_unequipitem(sd, i, CalcStatus::LATER); } + pc_calcstatus(sd, 0); // save character chrif_save(sd); sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters // do same modify in login-server for the account, but no in char-server (it ask again login_id1 to login, and don't remember it) - clif_displaymessage(sd->sess, - "Your sex has been changed (need disconexion by the server)..."_s); - clif_setwaitclose(sd->sess); // forced to disconnect for the change + clif_fixpcpos(sd); // use clif_set0078_main_1d8 to send new sex to the client } } else diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 0a5df8a..751b6e1 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -3522,8 +3522,7 @@ int pc_setparam(dumb_ptr<map_session_data> sd, SP type, int val) } break; case SP::SEX: - // this is a really bad idea - sd->sex = static_cast<SEX>(val); + chrif_char_ask_name(AccountId(), sd->status_key.name, 5, HumanTimeDiff()); break; case SP::WEIGHT: sd->weight = val; diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 17fe943..af6a9f2 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -1987,20 +1987,6 @@ void builtin_resetstatus(ScriptState *st) } /*========================================== - * 性別変換 - *------------------------------------------ - */ -static -void builtin_changesex(ScriptState *st) -{ - dumb_ptr<map_session_data> sd = nullptr; - sd = script_rid2sd(st); - - chrif_char_ask_name(AccountId(), sd->status_key.name, 5, HumanTimeDiff()); // type: 5 - changesex - chrif_save(sd); -} - -/*========================================== * RIDのアタッチ *------------------------------------------ */ @@ -3178,7 +3164,6 @@ BuiltinFunction builtin_functions[] = BUILTIN(sc_check, "i"_s, 'i'), BUILTIN(debugmes, "s"_s, '\0'), BUILTIN(resetstatus, ""_s, '\0'), - BUILTIN(changesex, ""_s, '\0'), BUILTIN(attachrid, "i"_s, 'i'), BUILTIN(detachrid, ""_s, '\0'), BUILTIN(isloggedin, "i"_s, 'i'), |