From 02ca832442632a618a28edef1d6d8051c9f3067b Mon Sep 17 00:00:00 2001 From: sonofole Date: Thu, 27 Jan 2022 09:56:28 -0800 Subject: [PATCH] apply trader price fix from AE-12.12-Main branch and add nodemon (#1) * update gitignore, add nodemon * apply trader price fix from AE-12.12-Main branch * whitespace * cleanup --- .gitignore | 2 ++ nodemon.json | 3 +++ package.json | 4 +++- src/classes/trader.js | 3 +-- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 nodemon.json diff --git a/.gitignore b/.gitignore index 13884df3..0f0fc563 100644 --- a/.gitignore +++ b/.gitignore @@ -22,5 +22,7 @@ desktop.ini .vscode/sftp.json user/configs/server.json user/profiles +user/logs +user/events/schedule.json user/configs/server.json .vscode/sftp.json diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 00000000..189659bd --- /dev/null +++ b/nodemon.json @@ -0,0 +1,3 @@ +{ + "watch": ["src", "core"] +} diff --git a/package.json b/package.json index ff129da7..1f84a561 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "author": "TheMaoci", "license": "MIT", "scripts": { - "start": "node core/main.js" + "start": "node core/main.js", + "watch": "nodemon --config nodemon.json ./core/main.js" }, "dependencies": { "crypto": "^1.0.1", @@ -18,6 +19,7 @@ "child_process": "1.0.2", "nexe": "3.3.3", "node-minify": "3.6.0", + "nodemon": "^2.0.15", "upx": "1.0.6" } } diff --git a/src/classes/trader.js b/src/classes/trader.js index d9317ea5..5f852bed 100644 --- a/src/classes/trader.js +++ b/src/classes/trader.js @@ -337,8 +337,7 @@ class TraderServer { if (!global._database.items[childItem._tpl]) { continue; } // Ignore child item if it does not have an entry in the db. -- kiobu - - let tempPrice = typeof global._database.itemPriceTable[childItem._tpl] != "undefined" ? global._database.itemPriceTable[childItem._tpl] : 1; + let tempPrice = global._database.items[childItem._tpl]._props.CreditsPrice >= 1 ? global._database.items[childItem._tpl]._props.CreditsPrice : 1; let count = "upd" in childItem && "StackObjectsCount" in childItem.upd ? childItem.upd.StackObjectsCount : 1; price = price + tempPrice * count; }