From 91a22ac34a3e6dc8536298537796e101424a430c Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 31 Jan 2023 00:30:47 +0000 Subject: terrain data is sent from server to client --- common/chunk.lua | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'common/chunk.lua') diff --git a/common/chunk.lua b/common/chunk.lua index 432e37b..e210387 100644 --- a/common/chunk.lua +++ b/common/chunk.lua @@ -1,17 +1,26 @@ +local json = require"common.dkjson" + local CHUNK_SIZE = 128 -- for now tiles shall be booleans +local function index_ok(offq,offr) + return 0<=offq and 0<=offr and offq