There's a bullet without my name on it.

This commit is contained in:
MarcEricMartel
2023-12-13 13:47:34 -05:00
parent d3c6353f17
commit 18d6d58203
5 changed files with 25 additions and 9 deletions

View File

@@ -202,8 +202,8 @@ void Server::Run() {
m_conns.erase(key);
continue;
}
int x = (rand() % (CHUNK_SIZE_X * WORLD_SIZE_X - 1) - (CHUNK_SIZE_X * WORLD_SIZE_X / 2)) / 8,
y = (rand() % (CHUNK_SIZE_Y * WORLD_SIZE_Y - 1) - (CHUNK_SIZE_Y * WORLD_SIZE_Y / 2)) / 8;
int x = (rand() % (CHUNK_SIZE_X * WORLD_SIZE_X - 1) - (CHUNK_SIZE_X * WORLD_SIZE_X / 2)) / 16,
y = (rand() % (CHUNK_SIZE_Y * WORLD_SIZE_Y - 1) - (CHUNK_SIZE_Y * WORLD_SIZE_Y / 2)) / 16;
conn->player = new Player(Vector3f(x + .5f, CHUNK_SIZE_Y + 1.8f, y + .5f));
conn->player->m_username = conn->GetName();
m_players[key] = conn->player;
@@ -280,11 +280,14 @@ void Server::Run() {
/* Process */
if (conn->m_nsync) {
if (conn->player->AmIDead())
conn->m_nsync = false;
Timestamp tstamp = conn->Run(m_world);
if (conn->player->AmIDead()) {
Chat* chat = new Chat();
chat->dest_id = chat->dest_team_id = chat->src_id = 0;
chat->dest_id = chat->dest_team_id = chat->src_id = 0;
std::string killer = m_conns.at(conn->player->Killer)->player->GetUsername();
@@ -293,7 +296,6 @@ void Server::Run() {
strcpy(chat->mess, 140, mess.c_str());
chatlog.emplace_back(chat);
++deadplayers;
conn->m_nsync = false;
}
else {
for (auto& chmo : conn->ChunkDiffs)