From f889e025cc403ceb6f6276d66fdc367f544a0e82 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 31 Jan 2016 23:39:10 -0500 Subject: do not force logout after sex change remove sex change roundtrip only unequip on gender incompatibility --- src/char/char.cpp | 32 -------------------------------- src/login/login.cpp | 46 ---------------------------------------------- src/map/pc.cpp | 9 ++------- 3 files changed, 2 insertions(+), 85 deletions(-) diff --git a/src/char/char.cpp b/src/char/char.cpp index 5effd32..1dc0e90 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -1977,38 +1977,6 @@ void parse_frommap(Session *ms) fixed_0f.error = 2; break; } - case 5: // changesex - case 6: // changesex - case 7: // changesex - { - if (!acc - || isGM(acc).overwhelms(isGM(ck->account_id))) - { - if (login_session) - { // don't send request if no login-server - Packet_Fixed<0x2727> fixed_27; - fixed_27.account_id = ck->account_id; - switch (operation) - { - case 5: - fixed_27.sex = SEX::FEMALE; - break; - case 6: - fixed_27.sex = SEX::MALE; - break; - case 7: - fixed_27.sex = SEX::NEUTRAL; - break; - } - send_fpacket<0x2727, 7>(login_session, fixed_27); - } - else - fixed_0f.error = 3; - } - else - fixed_0f.error = 2; - break; - } } } else diff --git a/src/login/login.cpp b/src/login/login.cpp index a1c6650..c071429 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -1175,52 +1175,6 @@ void parse_fromchar(Session *s) break; } - case 0x2727: // Change of sex (sex is reversed) - { - Packet_Fixed<0x2727> fixed; - rv = recv_fpacket<0x2727, 7>(s, fixed); - if (rv != RecvResult::Complete) - break; - - { - AccountId acc = fixed.account_id; - for (AuthData& ad : auth_data) - { - if (ad.account_id == acc) - { - { - SEX sex = fixed.sex; - LOGIN_LOG("Char-server '%s': Sex change (account: %d, new sex %c, ip: %s).\n"_fmt, - server[id].name, acc, - sex_to_char(sex), - ip); - for (int j = 0; j < AUTH_FIFO_SIZE; j++) - { - if (auth_fifo[j].account_id == acc) - auth_fifo[j].login_id1++; // to avoid reconnection error when come back from map-server (char-server will ask again the authentification) - } - ad.sex = sex; - - Packet_Fixed<0x2723> fixed_23; - fixed_23.account_id = acc; - fixed_23.sex = sex; - - for (Session *ss : iter_char_sessions()) - { - send_fpacket<0x2723, 7>(ss, fixed_23); - } - } - goto x2727_out; - } - } - LOGIN_LOG("Char-server '%s': Error of sex change (account: %d not found, sex would be reversed, ip: %s).\n"_fmt, - server[id].name, acc, ip); - x2727_out: - ; - } - break; - } - case 0x2728: // We receive account_reg2 from a char-server, and we send them to other char-servers. { Packet_Head<0x2728> head; diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 389f6b5..cb115c3 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -3487,33 +3487,28 @@ int pc_setparam(dumb_ptr sd, SP type, int val) } break; case SP::SEX: - int operation; switch (val) { case 0: sd->sex = sd->status.sex = SEX::FEMALE; - operation = 5; break; case 1: sd->sex = sd->status.sex = SEX::MALE; - operation = 6; break; default: sd->sex = sd->status.sex = SEX::NEUTRAL; - operation = 7; break; } for (IOff0 j : IOff0::iter()) { if (sd->status.inventory[j].nameid - && bool(sd->status.inventory[j].equip)) + && bool(sd->status.inventory[j].equip) + && !pc_isequip(sd, j)) pc_unequipitem(sd, j, CalcStatus::LATER); } pc_calcstatus(sd, 0); chrif_save(sd); - sd->login_id1++; clif_fixpcpos(sd); - chrif_char_ask_name(AccountId(), sd->status_key.name, operation, HumanTimeDiff()); break; case SP::WEIGHT: sd->weight = val; -- cgit v1.2.3-70-g09d2