mirror of
https://github.com/Burn-E99/TheArtificer.git
synced 2026-06-04 09:03:50 -04:00
Sonar Cleanup - Phase 2
This commit is contained in:
@@ -12,4 +12,5 @@ sonar.exclusions=emojis
|
|||||||
sonar.sourceEncoding=UTF-8
|
sonar.sourceEncoding=UTF-8
|
||||||
|
|
||||||
# Exclusions for copy-paste detection
|
# Exclusions for copy-paste detection
|
||||||
#sonar.cpd.exclusions=
|
# constantCmds.ts is excluded to get rid of the duplicate code compliant. Sonar does not like you initializing JSON in ts files.
|
||||||
|
sonar.cpd.exclusions=src/constantCmds.ts
|
||||||
@@ -445,16 +445,16 @@ export const roll = (rollStr: string, maximiseRoll: boolean, nominalRoll: boolea
|
|||||||
// Count how many rerolled dice there are if the reroll flag was on
|
// Count how many rerolled dice there are if the reroll flag was on
|
||||||
let rerollCount = 0;
|
let rerollCount = 0;
|
||||||
if (rollConf.reroll.on) {
|
if (rollConf.reroll.on) {
|
||||||
for (let i = 0; i < rollSet.length; i++) {
|
for (let j = 0; j < rollSet.length; j++) {
|
||||||
// If loopCount gets too high, stop trying to calculate infinity
|
// If loopCount gets too high, stop trying to calculate infinity
|
||||||
if (loopCount > MAXLOOPS) {
|
if (loopCount > MAXLOOPS) {
|
||||||
throw new Error('MaxLoopsExceeded');
|
throw new Error('MaxLoopsExceeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
log(LT.LOG, `Handling roll ${rollStr} | Setting originalIdx on ${JSON.stringify(rollSet[i])}`);
|
log(LT.LOG, `Handling roll ${rollStr} | Setting originalIdx on ${JSON.stringify(rollSet[j])}`);
|
||||||
rollSet[i].origidx = i;
|
rollSet[j].origidx = j;
|
||||||
|
|
||||||
if (rollSet[i].rerolled) {
|
if (rollSet[j].rerolled) {
|
||||||
rerollCount++;
|
rerollCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user