Skip to content

Commit

Permalink
fix: Rolls back the price change.
Browse files Browse the repository at this point in the history
  • Loading branch information
xdy committed Sep 20, 2020
1 parent 9070c8f commit 799a72c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions src/module/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ export class Migration {
}

if (before(systemMigrationVersion, "0.6.25")) {
let cost;
try {
const price = item.data.price as string;
cost = Number(price.toLowerCase().replace(" ", "").replace("cr", ""));
} catch (e) {
cost = 0;
const message = game.i18n.format("TWODSIX.Migration.MigrationError0_6_25", {
name: item.name,
price: item.data.price
});
console.log(message);
ui.notifications.warn(message);
}
updateData['data.price'] = cost;
// let cost;
// try {
// const price = item.data.price as string;
// cost = Number(price.toLowerCase().replace(" ", "").replace("cr", ""));
// } catch (e) {
// cost = 0;
// const message = game.i18n.format("TWODSIX.Migration.MigrationError0_6_25", {
// name: item.name,
// price: item.data.price
// });
// console.log(message);
// ui.notifications.warn(message);
// }
// updateData['data.price'] = cost;

if (item.type === 'weapon') {
updateData['data.lawLevel'] = 0;
Expand Down
2 changes: 1 addition & 1 deletion static/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
"shortdescr": "",
"quantity": 1,
"weight": 0,
"price": 0,
"price": "",
"traits": [],
"equipped": {
"weight": 0
Expand Down

0 comments on commit 799a72c

Please sign in to comment.