offset y pair de1984ificado

This commit is contained in:
simio 2025-07-03 07:55:27 -03:00
parent 209da52527
commit 63d0fac173

View File

@ -293,7 +293,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
QString l_other_emote = "0"; QString l_other_emote = "0";
QString l_other_offset = "0"; QString l_other_offset = "0";
QString l_other_flip = "0"; QString l_other_flip = "0";
QString new_offset = "0&0"; QString new_offset = l_incoming_args[17].toString();
if (client.m_pairing_with != -1) { if (client.m_pairing_with != -1) {
for (int l_client_id : area->joinedIDs()) { for (int l_client_id : area->joinedIDs()) {
AOClient *l_client = client.getServer()->getClientByID(l_client_id); AOClient *l_client = client.getServer()->getClientByID(l_client_id);
@ -306,7 +306,6 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
} }
} }
} }
bool autopaired = false;
if (!l_pairing) { if (!l_pairing) {
if (client.autopair && client.m_pos == "wit" && area->status() != AreaData::Status::CASING) { if (client.autopair && client.m_pos == "wit" && area->status() != AreaData::Status::CASING) {
int pair_index = -1; int pair_index = -1;
@ -337,16 +336,13 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
AOClient *l_client = client.getServer()->getClientByID(l_client_id); AOClient *l_client = client.getServer()->getClientByID(l_client_id);
if (l_client->m_char_id == l_other_charid && l_client->autopair && l_client->m_pos == client.m_pos) { if (l_client->m_char_id == l_other_charid && l_client->autopair && l_client->m_pos == client.m_pos) {
client_found = true; client_found = true;
autopaired = true;
l_other_name = l_client->m_current_iniswap; l_other_name = l_client->m_current_iniswap;
l_other_emote = l_client->m_emote; l_other_emote = l_client->m_emote;
l_other_flip = l_client->m_flipping; l_other_flip = l_client->m_flipping;
int offset = pair_index == 0 ? -25 : 25; int offset = pair_index == 0 ? -25 : 25;
if(l_client->hide_desk || client.hide_desk) l_args[0] = "0"; if(l_client->hide_desk || client.hide_desk) l_args[0] = "0";
new_offset = QString::number(offset); if(new_offset == "0&0" || new_offset == "") new_offset = QString::number(offset);
if(l_client->m_offset == "0&0" || l_client->m_offset == "") { if(l_client->m_offset == "0&0" || l_client->m_offset == "") l_other_offset = QString::number(offset * -1);
l_other_offset = QString::number(offset * -1);
}
else l_other_offset = l_client->m_offset; else l_other_offset = l_client->m_offset;
l_front_back = l_front_back == "" ? "^0" : l_front_back; l_front_back = l_front_back == "" ? "^0" : l_front_back;
} }
@ -358,20 +354,15 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
area->m_autopair[1] = client.m_char_id; area->m_autopair[1] = client.m_char_id;
} }
area->m_lastWitChar = client.m_char_id; area->m_lastWitChar = client.m_char_id;
}else{
l_other_charid = -1;
l_front_back = "";
} }
}else {
l_other_charid = -1;
l_front_back = "";
} }
l_args.append(QString::number(l_other_charid) + l_front_back); l_args.append(QString::number(l_other_charid) + l_front_back);
l_args.append(l_other_name); l_args.append(l_other_name);
l_args.append(l_other_emote); l_args.append(l_other_emote);
client.m_offset = new_offset;
// self offset
if (!autopaired) {
client.m_offset = l_incoming_args[17].toString();
new_offset = client.m_offset;
}
// versions 2.6-2.8 cannot validate y-offset so we send them just the x-offset // versions 2.6-2.8 cannot validate y-offset so we send them just the x-offset
if ((client.m_version.release == 2) && (client.m_version.major == 6 || client.m_version.major == 7 || client.m_version.major == 8)) { if ((client.m_version.release == 2) && (client.m_version.major == 6 || client.m_version.major == 7 || client.m_version.major == 8)) {
QString l_x_offset = new_offset.split("&")[0]; QString l_x_offset = new_offset.split("&")[0];