Skip to content

Commit

Permalink
Fix null in words array
Browse files Browse the repository at this point in the history
  • Loading branch information
WicopeeDot committed Apr 2, 2022
1 parent 1320463 commit dd735c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ module.exports = class Parser {
if (sound._SD) {
if (realm === -1)
realm = 1 + Math.floor(Math.random() * (sound._SD.length - 1))
additional = sound._SD[sound._SD.length - realm - 2];
additional = sound._SD[sound._SD.length - realm - 1];
}

realm = -1;
Expand All @@ -201,7 +201,7 @@ module.exports = class Parser {
let choose = 1 + Math.floor(Math.random() * (next._SD.length - 1))
if (iter === iterations && realm !== -1)
choose = realm;
newWords.push(next._SD[next._SD.length - choose - 2]);
newWords.push(next._SD[next._SD.length - choose - 1]);
}

if (additional)
Expand Down

0 comments on commit dd735c7

Please sign in to comment.