Swapped loadstring for load
Getty Ritter
8 years ago
| 24 | 24 |
function loadBoard(filename)
|
| 25 | 25 |
local f = io.open(filename)
|
| 26 | 26 |
if f then
|
| 27 | |
data = loadstring('return ' .. f:read('*all'))()
|
| 27 |
data = load('return ' .. f:read('*all'))()
|
| 28 | 28 |
local t = {
|
| 29 | 29 |
base = {},
|
| 30 | 30 |
entity = {},
|
| 6 | 6 |
|
| 7 | 7 |
function Entity:new(state, x, y, name)
|
| 8 | 8 |
local file = io.open('entities/' .. name .. '.lua')
|
| 9 | |
local char_data = loadstring('return' .. file:read('*all'))()
|
| 9 |
local char_data = load('return' .. file:read('*all'))()
|
| 10 | 10 |
|
| 11 | 11 |
local sprites = {}
|
| 12 | 12 |
for name, sprite in pairs(char_data.sprites) do
|
| 13 | 13 |
local f = io.open('tiles/' .. name .. '.lua')
|
| 14 | 14 |
local t
|
| 15 | 15 |
if f then
|
| 16 | |
t = loadstring('return' .. f:read('*all'))()
|
| 16 |
t = load('return' .. f:read('*all'))()
|
| 17 | 17 |
f:close()
|
| 18 | 18 |
if t.animation then
|
| 19 | 19 |
t.totalFrames = #t.animation
|