summaryrefslogtreecommitdiff
path: root/common/chunk.lua
diff options
context:
space:
mode:
Diffstat (limited to 'common/chunk.lua')
-rw-r--r--common/chunk.lua4
1 files changed, 4 insertions, 0 deletions
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}