remove the change_locales code, this feature was moved in eressea/locales.lua some time ago

This commit is contained in:
Enno Rehling 2015-04-04 08:55:58 +02:00
parent d802b297e9
commit 757e196973

View file

@ -26,18 +26,6 @@ function callbacks(rules, name, ...)
end end
end end
local function change_locales(localechange)
for loc, flist in pairs(localechange) do
for index, name in pairs(flist) do
f = get_faction(atoi36(name))
if f ~= nil and f.locale ~= loc then
print("LOCALECHANGE ", f, f.locale, loc)
f.locale = loc
end
end
end
end
local function dbupdate() local function dbupdate()
update_scores() update_scores()
dbname = config.dbname or 'eressea.db' dbname = config.dbname or 'eressea.db'
@ -127,64 +115,65 @@ local function write_scores()
end end
function process(rules, orders) function process(rules, orders)
local confirmed_multis = { } local confirmed_multis = { }
local suspected_multis = { } local suspected_multis = { }
if open_game(get_turn())~=0 then if open_game(get_turn())~=0 then
eressea.log.error("could not read game") eressea.log.error("could not read game")
return -1 return -1
end end
callbacks(rules, 'init')
init_summary()
-- run the turn: callbacks(rules, 'init')
if read_orders(orders) ~= 0 then init_summary()
print("could not read " .. orders)
return -1
end
plan_monsters() -- run the turn:
if read_orders(orders) ~= 0 then
print("could not read " .. orders)
return -1
end
if nmr_check(config.maxnmrs or 80)~=0 then plan_monsters()
return -1
end
process_orders() if nmr_check(config.maxnmrs or 80)~=0 then
callbacks(rules, 'update') return -1
end
local localechange = { de = { 'ii' } } process_orders()
change_locales(localechange) callbacks(rules, 'update')
write_files(config.locales) write_files(config.locales)
file = '' .. get_turn() .. '.dat' file = '' .. get_turn() .. '.dat'
if eressea.write_game(file)~=0 then if eressea.write_game(file)~=0 then
eressea.log.error("could not write game") eressea.log.error("could not write game")
return -1 return -1
end end
return 0 return 0
end end
function run_turn(rules) function run_turn(rules)
local turn = get_turn() local turn = get_turn()
if turn<0 then if turn<0 then
turn = read_turn() turn = read_turn()
set_turn(turn) set_turn(turn)
end end
orderfile = orderfile or config.basepath .. '/orders.' .. turn orderfile = orderfile or config.basepath .. '/orders.' .. turn
eressea.log.debug("executing turn " .. get_turn() .. " with " .. orderfile .. " with rules=" .. config.rules) eressea.log.debug("executing turn " .. get_turn() .. " with " .. orderfile .. " with rules=" .. config.rules)
local result = process(rules, orderfile) local result = process(rules, orderfile)
if result==0 then if result==0 then
dbupdate() dbupdate()
end end
return result return result
end end
function file_exists(name) function file_exists(name)
local f=io.open(name,"r") local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end if not f then
return false
end
io.close(f)
return true
end end
if file_exists('execute.lock') then if file_exists('execute.lock') then