Skip to content

Commit

Permalink
fix: login after death and prey window oldprotocol (opentibiabr#2776)
Browse files Browse the repository at this point in the history
  • Loading branch information
kokekanon authored Jul 28, 2024
1 parent fa85e18 commit fccf435
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/server/network/protocol/protocolgame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ class ProtocolGame final : public Protocol {
bool oldProtocol = false;

uint16_t otclientV8 = 0;
bool isOTC = false;

void sendInventory();
void sendOpenStash();
Expand Down

0 comments on commit fccf435

Please sign in to comment.