Skip to content

Commit

Permalink
apply trader price fix from AE-12.12-Main branch and add nodemon (#1)
Browse files Browse the repository at this point in the history
* update gitignore, add nodemon

* apply trader price fix from AE-12.12-Main branch

* whitespace

* cleanup
  • Loading branch information
sonofole authored Jan 27, 2022
1 parent 70a3d02 commit 02ca832
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"watch": ["src", "core"]
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
3 changes: 1 addition & 2 deletions src/classes/trader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 02ca832

Please sign in to comment.