From 7e98eeb852ad2841b8d653c5eb61f7303a9befd4 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Thu, 7 Dec 2023 15:47:31 -0500 Subject: [PATCH] whyyyyyyyyy --- SQCSim-srv/server.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/SQCSim-srv/server.cpp b/SQCSim-srv/server.cpp index 5314c31..e465a6a 100644 --- a/SQCSim-srv/server.cpp +++ b/SQCSim-srv/server.cpp @@ -305,9 +305,6 @@ void Server::Run() { chunkdiffs.emplace_back(std::move(chmo)); conn->ChunkDiffs.clear(); - std::string str = conn->player->GetUsername(); - Log(str.append(" ").append(std::to_string(conn->player->GetHP())), false, false); - for (auto& bull : conn->Bullets) { bullets.emplace_back(bull); Log("POW!", false, false); @@ -347,6 +344,10 @@ void Server::Run() { } } + for (auto gtfo : outbox_bullets) + delete gtfo; + outbox_bullets.clear(); + for (auto& chat : chatlog) { Log(chat->mess, false, false); for (auto& [key, conn] : m_conns) @@ -371,6 +372,12 @@ void Server::Run() { end.src_id = 0; char endmess[] = "Game over, man. Game over."; + for (auto& [key, conn] : m_conns) { + std::string str = conn->player->GetUsername(); + Log(str.append(" ").append(std::to_string(conn->player->GetHP())), false, false); + + } + strcpy(end.mess, 140, endmess); for (auto& [key, conn] : m_conns)