game: fix stray discovery notifications on startup

This commit is contained in:
Crypto City 2021-06-01 16:51:58 +00:00
parent 99e5342b6f
commit ce990e0615

View File

@ -237,7 +237,7 @@ void GameState::update(const std::shared_ptr<GameWallet> &wallet, uint64_t top_h
{
if (e.discovery_height != 0)
research_leaderboard.add_score(e.discoverer, 1);
if (e.discovery_height > prev_top_height && e.discovery_height <= top_height && e.discovery_height + 86400 / DIFFICULTY_TARGET_V2 / 24 >= top_height)
if (prev_top_height > 0 && e.discovery_height > prev_top_height && e.discovery_height <= top_height && e.discovery_height + 86400 / DIFFICULTY_TARGET_V2 / 24 >= top_height)
SendGameNotification(true, String(get_player_name(e.discoverer).c_str()) + " discovered " + e.name.c_str());
}
}