Oh oh oh oh oh!!!
This commit is contained in:
@@ -276,16 +276,14 @@ void Server::Run() {
|
||||
Chat* chat = new Chat();
|
||||
chat->dest_id = chat->dest_team_id = chat->src_id = 0;
|
||||
|
||||
std::string killer = m_conns.at(key)->player->GetUsername();
|
||||
std::string killer = m_conns.at(conn->player->Killer)->player->GetUsername();
|
||||
|
||||
std::string mess = getDeathMessage(conn->player->GetUsername(), killer);
|
||||
|
||||
strcpy(chat->mess, 140, mess.c_str());
|
||||
Log(mess, false, false);
|
||||
|
||||
chatlog.emplace_back(chat);
|
||||
++deadplayers;
|
||||
conn->m_nsync == false;
|
||||
conn->m_nsync = false;
|
||||
}
|
||||
else {
|
||||
for (auto& chmo : conn->ChunkDiffs)
|
||||
@@ -342,12 +340,6 @@ void Server::Run() {
|
||||
delete chmo;
|
||||
}
|
||||
|
||||
//for (auto& bull : outbox_bullets)
|
||||
//delete bull;
|
||||
|
||||
//for (auto& bull : netbull)
|
||||
//delete bull;
|
||||
|
||||
outbox_bullets.clear();
|
||||
netbull.clear();
|
||||
chunkdiffs.clear();
|
||||
@@ -358,7 +350,7 @@ void Server::Run() {
|
||||
end.src_id = 0;
|
||||
char endmess[] = "Game over, mothereffers.";
|
||||
|
||||
strcpy(end.mess, endmess);
|
||||
strcpy(end.mess, 140, endmess);
|
||||
|
||||
for (auto& [key, conn] : m_conns)
|
||||
sendPackTo<Chat>(m_sock_udp, &end, &m_buf, conn->getAddr());
|
||||
@@ -451,6 +443,7 @@ std::string Server::getDeathMessage(std::string username, std::string killer) co
|
||||
mess.append(killer);
|
||||
mess.append(temp.substr(indk + 1));
|
||||
}
|
||||
else mess.append(temp.substr(ind + 1));
|
||||
}
|
||||
else {
|
||||
mess.append(temp.substr(0, indk));
|
||||
|
Reference in New Issue
Block a user