Make player spawn point random working?

This commit is contained in:
MarcEricMartel 2023-12-08 05:07:05 -05:00
parent 3da68297e4
commit 63d70be488

View File

@ -204,8 +204,8 @@ void Server::Run() {
m_conns.erase(key);
continue;
}
int x = 0,// (rand() % (CHUNK_SIZE_X * WORLD_SIZE_X - 1)),// -(CHUNK_SIZE_X * WORLD_SIZE_X / 2),
y = 0;// (rand() % (CHUNK_SIZE_Y * WORLD_SIZE_Y - 1));// -(CHUNK_SIZE_Y * WORLD_SIZE_Y / 2);
int x = (rand() % (CHUNK_SIZE_X * WORLD_SIZE_X - 1) - (CHUNK_SIZE_X * WORLD_SIZE_X / 2)) / 4,
y = (rand() % (CHUNK_SIZE_Y * WORLD_SIZE_Y - 1) - (CHUNK_SIZE_Y * WORLD_SIZE_Y / 2)) / 4;
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;
@ -231,7 +231,7 @@ void Server::Run() {
Chat* startchat = new Chat();
startchat->src_id = 0;
char startmess[] = "How would -YOU- like to die today, motherfuckers?";
char startmess[] = "How would -YOU- like to die today, motherf-words?";
strcpy(startchat->mess, 140, startmess);
@ -342,7 +342,6 @@ void Server::Run() {
delete bullet;
}
}
for (auto& bull: bullit)
bullets.erase(bull);
bullit.clear();