Corrige les stats du casinouz.

parent d004e063
......@@ -135,10 +135,12 @@ if(!zouz.has("bank"))
zouz.set("bank", 0);
if(fs.existsSync("../savedData/casinouz.json"))
const casinouzFile = __dirname + "/../savedData/casinouz.json";
if(fs.existsSync(casinouzFile))
{
try {
casinouz = require("../savedData/casinouz.json");
casinouz = require(casinouzFile);
}
catch(e) {
console.error(e);
......@@ -148,12 +150,12 @@ if(fs.existsSync("../savedData/casinouz.json"))
function saveCasinouz()
{
if(savingCasinouz === true)
if(savingCasinouz)
savingCasinouz = setTimeout(saveCasinouz, 500);
else
{
savingCasinouz = true;
fs.writeFile("../savedData/casinouz.json", JSON.stringify(casinouz), err => { if(err) error(err); savingCasinouz = false; });
fs.writeFile(casinouzFile, JSON.stringify(casinouz), err => { if(err) error(err); savingCasinouz = false; });
}
}
......
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