searching of talents aborted prematurely.

This commit is contained in:
Marcus Netz
2020-11-24 22:15:45 +01:00
parent e17476db21
commit f536a02a45
2 changed files with 16 additions and 16 deletions

View File

@ -7,7 +7,7 @@ module.exports = async (message, args, db) => {
return;
}
let level = 8;
let attributename;
let attributename;
await db.find({
user: message.author.tag,
@ -24,7 +24,9 @@ module.exports = async (message, args, db) => {
// try to get id of short formatted attributes.
if (args[0].length == 2) {
for (const i in globals.Werte) {
if (globals.Werte[i].kuerzel == args[0].toUpperCase()) attributename = globals.Werte[i].id;
if (globals.Werte[i].kuerzel == args[0].toUpperCase()) {
attributename = globals.Werte[i].id;
}
}
}
else {

View File

@ -15,18 +15,16 @@ module.exports = async (message, args, db) => {
}
const values = [];
const roll = [];
let found = false;
let talent
let bonus = 0;
let ok = 0;
let patzer = 0;
let crit = 0;
for (i in docs[0].character.skills) {
if (docs[0].character.skills[i].id == args[0]) {bonus = docs[0].character.skills[i].level; found = true;}
}
if (!found) {
message.reply('Sorry, das Talent ist mir unbekannt.');
return;
if (docs[0].character.skills[i].id == talent) {bonus = docs[0].character.skills[i].level;}
}
const bonus_orig = bonus;
const result = globals.Talente.find(talent => talent.id === args[0]);