mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
Add 2.0 support to core lua
This commit is contained in:
6 files changed
+46
-54
No files matched your search
@@ -137,12 +137,16 @@ end
|
||||
|
||||
if major_v1_1 then
|
||||
-- Game is not always available so it needs to be called within another function
|
||||
-- Can not use ... here because of luals type suggestion breaking when it is used
|
||||
-- TODO maybe include a version that does not require game?
|
||||
compat.table_to_json = function(...) return game.table_to_json(...) end
|
||||
compat.json_to_table = function(...) return game.json_to_table(...) end
|
||||
compat.write_file = function(...) return game.write_file(...) end
|
||||
|
||||
compat.table_to_json = function(tbl) return game.table_to_json(tbl) end
|
||||
compat.json_to_table = function(tbl) return game.json_to_table(tbl) end
|
||||
compat.write_file = function(filename, data, append, for_player) return game.write_file(filename, data, append, for_player) end
|
||||
elseif major_v2 then
|
||||
compat.table_to_json = helpers.table_to_json
|
||||
compat.json_to_table = helpers.json_to_table
|
||||
compat.write_file = helpers.write_file
|
||||
end
|
||||
|
||||
return compat
|
||||
Reference in new issue
Block a user