forked from github/server
in Lua 5.2, table.getn no longer exists
This commit is contained in:
parent
afd41286b5
commit
71056cc2e5
|
@ -80,7 +80,8 @@ local function market_action(r)
|
||||||
end
|
end
|
||||||
|
|
||||||
local markets = {}
|
local markets = {}
|
||||||
local function markets.update()
|
|
||||||
|
function markets.update()
|
||||||
local r
|
local r
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
market_action(r)
|
market_action(r)
|
||||||
|
|
|
@ -9,7 +9,7 @@ local jokes = {
|
||||||
}
|
}
|
||||||
|
|
||||||
local function ponnuki_brain(u)
|
local function ponnuki_brain(u)
|
||||||
local i = math.random(table.getn(jokes))
|
local i = math.random(#jokes)
|
||||||
u:add_notice("Eine Botschaft von " .. tostring(u) .. ": " ..jokes[i])
|
u:add_notice("Eine Botschaft von " .. tostring(u) .. ": " ..jokes[i])
|
||||||
local d = math.random(6)
|
local d = math.random(6)
|
||||||
local r = u.region:next(d-1)
|
local r = u.region:next(d-1)
|
||||||
|
|
|
@ -189,6 +189,7 @@ end
|
||||||
if config.install then
|
if config.install then
|
||||||
confdir = config.install .. '/' .. confdir
|
confdir = config.install .. '/' .. confdir
|
||||||
end
|
end
|
||||||
|
print(confdir)
|
||||||
read_xml(confdir .. 'config.xml', confdir .. 'catalog.xml')
|
read_xml(confdir .. 'config.xml', confdir .. 'catalog.xml')
|
||||||
|
|
||||||
local path = 'scripts'
|
local path = 'scripts'
|
||||||
|
@ -201,7 +202,7 @@ require 'eressea'
|
||||||
local rules = {}
|
local rules = {}
|
||||||
if config.rules then
|
if config.rules then
|
||||||
rules = require('eressea.' .. config.rules)
|
rules = require('eressea.' .. config.rules)
|
||||||
eressea.log.info('loaded ' .. table.getn(rules) .. ' modules for ' .. config.rules)
|
eressea.log.info('loaded ' .. #rules .. ' modules for ' .. config.rules)
|
||||||
else
|
else
|
||||||
eressea.log.warning('no rule modules loaded, specify a game in eressea.ini or with -r')
|
eressea.log.warning('no rule modules loaded, specify a game in eressea.ini or with -r')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue