aboutsummaryrefslogtreecommitdiff
path: root/server/src/game.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-19 13:01:18 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-23 19:21:22 +0200
commitc55d90768a9336436238dd93ae1706e23e281e84 (patch)
treea8d70b76100ae539d0659caa1c62dd0594a05817 /server/src/game.rs
parentbcbc56d161ac78a48dcca88e5671d333614d7425 (diff)
downloadhurrycurry-c55d90768a9336436238dd93ae1706e23e281e84.tar
hurrycurry-c55d90768a9336436238dd93ae1706e23e281e84.tar.bz2
hurrycurry-c55d90768a9336436238dd93ae1706e23e281e84.tar.zst
send neighbours on map updatre
Diffstat (limited to 'server/src/game.rs')
-rw-r--r--server/src/game.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/src/game.rs b/server/src/game.rs
index 9c1bdd29..228d7048 100644
--- a/server/src/game.rs
+++ b/server/src/game.rs
@@ -85,6 +85,12 @@ impl Game {
for (&tile, tdata) in &self.tiles {
out.push(PacketC::UpdateMap {
pos: tile,
+ neighbours: [
+ self.tiles.get(&(tile + IVec2::NEG_Y)).map(|e| e.kind),
+ self.tiles.get(&(tile + IVec2::NEG_X)).map(|e| e.kind),
+ self.tiles.get(&(tile + IVec2::Y)).map(|e| e.kind),
+ self.tiles.get(&(tile + IVec2::X)).map(|e| e.kind),
+ ],
tile: tdata.kind.clone(),
});
if let Some(item) = &tdata.item {