Skip to content

Commit

Permalink
Fix outputDebugString level 4 colors (PR multitheftauto#3474)
Browse files Browse the repository at this point in the history
  • Loading branch information
MegadreamsBE authored Jun 17, 2024
1 parent f8d9b43 commit 5d4d7df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Client/mods/deathmatch/logic/CPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ void CPacketHandler::Packet_DebugEcho(NetBitStreamInterface& bitStream)
if (!bitStream.Read(ucLevel))
return;

if (ucLevel == 0)
if (ucLevel == 0 || ucLevel == 4)
{
// Read out the color
if (!bitStream.Read(ucRed) || !bitStream.Read(ucGreen) || !bitStream.Read(ucBlue))
Expand All @@ -1481,7 +1481,7 @@ void CPacketHandler::Packet_DebugEcho(NetBitStreamInterface& bitStream)
}

// Valid length?
int iBytesRead = (ucLevel == 0) ? 4 : 1;
int iBytesRead = (ucLevel == 0 || ucLevel == 4) ? 4 : 1;
int iNumberOfBytesUsed = bitStream.GetNumberOfBytesUsed() - iBytesRead;
if (iNumberOfBytesUsed >= MIN_DEBUGECHO_LENGTH && iNumberOfBytesUsed <= MAX_DEBUGECHO_LENGTH)
{
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/packets/CDebugEchoPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bool CDebugEchoPacket::Write(NetBitStreamInterface& BitStream) const
{
// Write the level
BitStream.Write(static_cast<unsigned char>(m_uiLevel));
if (m_uiLevel == 0)
if (m_uiLevel == 0 || m_uiLevel == 4)
{
// Write the color
BitStream.Write(m_ucRed);
Expand Down

0 comments on commit 5d4d7df

Please sign in to comment.