summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/data/data_hiscore.lua
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-11-02 12:14:39 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-11-02 12:16:10 -0500
commitbfc49b0974e4d040122dc8e546992d0ebdc418aa (patch)
tree14384314d7a5dc49aedbdf11d7e9c1b4270f9ad4 /plugins/data/data_hiscore.lua
parent431f8d361140dff4b2990a0845d8958281c90162 (diff)
luaengine: bugfixes (nw)
Diffstat (limited to 'plugins/data/data_hiscore.lua')
-rw-r--r--plugins/data/data_hiscore.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/data/data_hiscore.lua b/plugins/data/data_hiscore.lua
index 3e46fabe50a..5f2214d814d 100644
--- a/plugins/data/data_hiscore.lua
+++ b/plugins/data/data_hiscore.lua
@@ -654,13 +654,15 @@ function dat.check(set, softlist)
local newbytes = {}
if skip == "odd" then
for i = 1, #bytes, 2 do
- val = bytes[i]:byte(1)
- newbytes[(i+1)/2] = string.char(((val & 0x0f) << 4) | (val & 0x0f))
+ val1 = bytes[i]:byte(1)
+ val2 = bytes[i+1]:byte(1)
+ newbytes[(i+1)/2] = string.char(((val1 & 0x0f) << 4) | (val2 & 0x0f))
end
elseif skip == "even" then
for i = 1, #bytes, 2 do
- val = bytes[i]:byte(1)
- newbytes[(i+1)/2] = string.char((val & 0xf0) | ((val & 0xf0) >> 4))
+ val1 = bytes[i]:byte(1)
+ val2 = bytes[i+1]:byte(1)
+ newbytes[(i+1)/2] = string.char((val1 & 0xf0) | ((val2 & 0xf0) >> 4))
end
end
return newbytes