Commit 6f99f65d authored by nanahira's avatar nanahira

detect operating system

parent 1def9379
...@@ -26,7 +26,12 @@ function Auxiliary.SplitData(inputstr) ...@@ -26,7 +26,12 @@ function Auxiliary.SplitData(inputstr)
return t return t
end end
function Auxiliary.LoadDB(p,pool) function Auxiliary.LoadDB(p,pool)
local file=io.popen("echo \"select * from datas;\" | sqlite3 "..pool) local file=nil
if HOSTED_ON_WINDOWS then
file=io.popen("bash echo \"select * from datas;\" | sqlite3 "..pool)
else
file=io.popen("echo \"select * from datas;\" | sqlite3 "..pool)
end
for line in file:lines() do for line in file:lines() do
local data=Auxiliary.SplitData(line) local data=Auxiliary.SplitData(line)
local code=data[1] local code=data[1]
......
...@@ -668,6 +668,11 @@ interpreter::interpreter(duel* pd): coroutines(256) { ...@@ -668,6 +668,11 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal(lua_state, "HINT_SOUND"); lua_setglobal(lua_state, "HINT_SOUND");
lua_pushinteger(lua_state, HINT_MUSIC_OGG); lua_pushinteger(lua_state, HINT_MUSIC_OGG);
lua_setglobal(lua_state, "HINT_MUSIC_OGG"); lua_setglobal(lua_state, "HINT_MUSIC_OGG");
//detect operating system
#ifdef _WIN32
lua_pushboolean(lua_state, 1);
lua_setglobal(lua_state, "_WIN32");
#endif
//load init.lua by MLD //load init.lua by MLD
load_script((char*) "./expansions/script/init.lua"); load_script((char*) "./expansions/script/init.lua");
//2pick rule //2pick rule
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment