4char padding, do proper string concat on map..checksum

This commit is contained in:
Not 2022-07-19 21:03:40 +02:00
parent 907c07a25d
commit db0696294b
1 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ local function mapChecksum(mapnum)
return nil
end
local digest = string.format("%02x", djb2(mh.lvlttl+mh.subttl+mh.zonttl))
local digest = string.format("%04x", djb2(mh.lvlttl+mh.subttl+mh.zonttl))
return string.sub(digest, #digest - 3)
end
@ -173,13 +173,13 @@ local function setST(t, map, flags, scoreTable)
local mode = flags & ST_SEP
local cks = mapChecksum(map)
t[mode] = t[mode] or {}
t[mode][map + (cks or "")] = scoreTable
t[mode][tostring(map)..(cks or "")] = scoreTable
end
local function getST(t, map, flags)
local mode = flags & ST_SEP
local cks = mapChecksum(map)
return t[mode] and t[mode][map + (cks or "")] or nil
return t[mode] and t[mode][tostring(map)..(cks or "")] or nil
end
local function setScoreTable(map, flags, scoreTable)