fix: lobby timer
This commit is contained in:
@@ -27,7 +27,7 @@ ClientGame::~ClientGame(){
|
||||
void ClientGame::tick(std::uint64_t delta){
|
||||
game::Game::tick(delta);
|
||||
m_WorldRenderer.update();
|
||||
if (m_GameState == game::GameState::Lobby && m_Players.size() >= 2){
|
||||
if (m_GameState == game::GameState::Lobby && m_LobbyTime > 0){
|
||||
m_LobbyTime -= delta;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ void Lobby::OnPlayerJoin(std::uint8_t playerID){
|
||||
if (m_Players.size() == 2){ // start timer if a second player join the match
|
||||
m_StartTimerTime = utils::getTime();
|
||||
m_Timer.reset();
|
||||
sendTimeRemaining();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user