aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2024-07-23 13:31:30 +0200
committernokoe <nokoe@mailbox.org>2024-07-23 13:31:30 +0200
commiteb6af5d8bf056bad6528509846d3735c31a2d061 (patch)
tree8960249f04f02198976c700d83738b643d5b7511 /server/src
parent1675781c5ee3cbd6e9dc9960a59fda58d9cb75c8 (diff)
downloadhurrycurry-eb6af5d8bf056bad6528509846d3735c31a2d061.tar
hurrycurry-eb6af5d8bf056bad6528509846d3735c31a2d061.tar.bz2
hurrycurry-eb6af5d8bf056bad6528509846d3735c31a2d061.tar.zst
send correct time in initial score packet
Diffstat (limited to 'server/src')
-rw-r--r--server/src/game.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/game.rs b/server/src/game.rs
index e3d170a1..1692de34 100644
--- a/server/src/game.rs
+++ b/server/src/game.rs
@@ -136,7 +136,10 @@ impl Game {
self.lobby = gamedata.map_name == "lobby";
self.data = gamedata.into();
- self.score = Score::default();
+ self.score = Score {
+ time_remaining: timer.map(|dur| dur.as_secs_f64()).unwrap_or(0.),
+ ..Default::default()
+ };
self.end = timer.map(|dur| Instant::now() + dur);
self.entities = Arc::new(RwLock::new(self.data.entities.clone()));