From 04664ee48de5fc8b06a584e20a4b75c41dafa558 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 31 Jan 2023 23:51:25 +0000 Subject: add sending of tile changes, between players. server remembers all changes made. also add better debug screen --- common/chunk.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common') diff --git a/common/chunk.lua b/common/chunk.lua index e210387..a9a8bc5 100644 --- a/common/chunk.lua +++ b/common/chunk.lua @@ -35,6 +35,10 @@ function Chunk.at(self,hoffs) if not index_ok(hoffs.q,hoffs.r) then return nil end return self.tiles[index(hoffs.q,hoffs.r)] end +function Chunk.set_at(self,hoffs,tile) + if not index_ok(hoffs.q,hoffs.r) then return end + self.tiles[index(hoffs.q,hoffs.r)] = tile +end function Chunk.data_packet(self) return json.encode{t="chunk",tiles=self.tiles} -- cgit v1.2.3