From f4bbfdf1024871dbf811142a91346af89297e703 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 28 Feb 2017 16:56:14 +0100 Subject: [PATCH] [Stats] Shorten size calculation --- src/Components/Modules/Stats.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Components/Modules/Stats.cpp b/src/Components/Modules/Stats.cpp index 80c8042d..df101b87 100644 --- a/src/Components/Modules/Stats.cpp +++ b/src/Components/Modules/Stats.cpp @@ -40,15 +40,10 @@ namespace Components // Stat packet index Game::MSG_WriteByte(&msg, i); - // calculate packet size - size_t size = 8192 - (i * 1240); - if (size > 1240) - size = 1240; - // write stat packet data if (statbuffer) { - Game::MSG_WriteData(&msg, statbuffer, size); + Game::MSG_WriteData(&msg, statbuffer, std::min(8192 - (i * 1240), 1240)); } // send statpacket