From fccf43522163a2d97e0d7dc3409d56d246c5074c Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Sat, 27 Jul 2024 20:46:10 -0400 Subject: [PATCH] fix: login after death and prey window oldprotocol (#2776) --- src/server/network/protocol/protocolgame.cpp | 15 +++++++-------- src/server/network/protocol/protocolgame.hpp | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index ae8510011b0..133f0335ff1 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -473,6 +473,7 @@ void ProtocolGame::login(const std::string &name, uint32_t accountId, OperatingS // Extended opcodes if (operatingSystem >= CLIENTOS_OTCLIENT_LINUX) { + isOTC = true; NetworkMessage opcodeMessage; opcodeMessage.addByte(0x32); opcodeMessage.addByte(0x00); @@ -923,8 +924,8 @@ void ProtocolGame::parsePacket(NetworkMessage &msg) { void ProtocolGame::parsePacketDead(uint8_t recvbyte) { if (recvbyte == 0x14) { - // Remove player from game if click "ok" using otcv8 - if (player && otclientV8 > 0) { + // Remove player from game if click "ok" using otc + if (player && isOTC) { g_game().removePlayerUniqueLogin(player->getName()); } disconnect(); @@ -4261,12 +4262,10 @@ void ProtocolGame::sendBasicData() { msg.addByte(player->getVocation()->getClientId()); // Prey window - if (!oldProtocol) { - if (player->getVocation()->getId() == 0 && player->getGroup()->id < GROUP_TYPE_GAMEMASTER) { - msg.addByte(0); - } else { - msg.addByte(1); // has reached Main (allow player to open Prey window) - } + if (player->getVocation()->getId() == 0 && player->getGroup()->id < GROUP_TYPE_GAMEMASTER) { + msg.addByte(0); + } else { + msg.addByte(1); // has reached Main (allow player to open Prey window) } // Filter only valid ids diff --git a/src/server/network/protocol/protocolgame.hpp b/src/server/network/protocol/protocolgame.hpp index 8e99aa68a54..f6b7be93cb2 100644 --- a/src/server/network/protocol/protocolgame.hpp +++ b/src/server/network/protocol/protocolgame.hpp @@ -503,6 +503,7 @@ class ProtocolGame final : public Protocol { bool oldProtocol = false; uint16_t otclientV8 = 0; + bool isOTC = false; void sendInventory(); void sendOpenStash();