Use actually random seeds

This commit is contained in:
IQuant 2024-05-14 22:53:09 +03:00
parent 356c7e5edc
commit ef2f5806a2
3 changed files with 15 additions and 3 deletions

View file

@ -120,6 +120,9 @@ function OnPlayerSpawned( player_entity ) -- This runs when player entity has be
np.SetPauseState(4) np.SetPauseState(4)
np.SetPauseState(0) np.SetPauseState(0)
local hp = util.get_ent_health(player_entity)
util.set_ent_health(player_entity, {hp*3, hp*3})
EntityAddTag(player_entity, "polymorphable_NOT") -- TODO EntityAddTag(player_entity, "polymorphable_NOT") -- TODO
if ctx.is_host then if ctx.is_host then

View file

@ -262,8 +262,15 @@ impl NetManager {
Some("game_over") => { Some("game_over") => {
if self.is_host() { if self.is_host() {
info!("Game over, resending game settings"); info!("Game over, resending game settings");
self.settings.lock().unwrap().seed += 1; {
info!("New seed: {}", self.settings.lock().unwrap().seed); let mut setting = self.settings.lock().unwrap();
if setting.debug_mode {
setting.seed += 1;
} else {
setting.seed = rand::random();
}
info!("New seed: {}", setting.seed);
}
self.resend_game_settings(); self.resend_game_settings();
} }
} }

View file

@ -35,3 +35,5 @@
- test tangled better - test tangled better
- poly on clients - poly on clients
- proxy: stop receiving connections before another start_game on game over, noita: try to reconnect to proxy. - proxy: stop receiving connections before another start_game on game over, noita: try to reconnect to proxy.
- sync traps