FIRST PERSON SHOOTER

This commit is contained in:
simio 2025-08-11 02:47:06 -03:00
parent 07a9f7b565
commit da300b358e

View File

@ -111,6 +111,9 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
} }
client.m_spoke = true; client.m_spoke = true;
if(client.hide_desk) l_incoming_deskmod = "0"; if(client.hide_desk) l_incoming_deskmod = "0";
else if(client.m_first_person){
l_incoming_deskmod = area->lastICMessage()[0];
}
if (allowed_desk_mods.contains(l_incoming_deskmod)) { if (allowed_desk_mods.contains(l_incoming_deskmod)) {
// **WARNING : THIS IS A HACK!** // **WARNING : THIS IS A HACK!**
// A proper solution would be to deprecate chat as an argument on the clientside // A proper solution would be to deprecate chat as an argument on the clientside
@ -198,14 +201,17 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
// side // side
// this is validated clientside so w/e // this is validated clientside so w/e
QString l_incoming_side = client.m_first_person ? area->lastICMessage()[5] : l_incoming_args[5].toString();
QString side = area->side(); QString side = area->side();
if (side.isEmpty()) { if (side.isEmpty()) {
side = l_incoming_args[5].toString(); side = l_incoming_side;
} }
l_args.append(side); l_args.append(side);
if (client.m_pos != l_incoming_args[5].toString()) { if (client.m_pos != l_incoming_side) {
client.m_pos = l_incoming_args[5].toString(); client.m_pos = l_incoming_side;
client.m_pos.replace("../", "").replace("..\\", ""); client.m_pos.replace("../", "").replace("..\\", "");
client.updateEvidenceList(client.getServer()->getAreaById(client.areaId())); client.updateEvidenceList(client.getServer()->getAreaById(client.areaId()));
} }
@ -317,10 +323,12 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
QString l_other_offset = "0"; QString l_other_offset = "0";
QString l_other_flip = "0"; QString l_other_flip = "0";
QString new_offset = l_incoming_args[17].toString(); QString new_offset = l_incoming_args[17].toString();
if(!client.m_first_person)
{
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);
if (l_client->m_pairing_with == client.m_char_id && l_other_charid != client.m_char_id && l_client->m_char_id == client.m_pairing_with && l_client->m_pos == client.m_pos) { if (!l_client->m_first_person && l_client->m_pairing_with == client.m_char_id && l_other_charid != client.m_char_id && l_client->m_char_id == client.m_pairing_with && l_client->m_pos == client.m_pos) {
l_pairing = true; l_pairing = 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;
@ -357,7 +365,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
continue; continue;
} }
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_first_person && l_client->m_char_id == l_other_charid && l_client->autopair && l_client->m_pos == client.m_pos) {
client_found = true; client_found = 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;
@ -382,6 +390,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
l_front_back = ""; 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);