fix/combat rating history limit set at 12

This commit is contained in:
SowinskiBraeden committed 2023-11-07 20:59:08 -08:00
1 parent 87d14c5d29
commit ee0ae4cdbf
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "dayzr-bot",
"version": "12.3.10",
"version": "12.3.11",
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
"main": "index.js",
"nodemonConfig": {
+2 -2
View File
@@ -195,8 +195,8 @@ module.exports = {
victimStat.combatRating = calculateNewCombatRating(victimStat.combatRating, killerStat.combatRating, 0);
if (killerStat.combatRating > killerStat.highestCombatRating) killerStat.highestCombatRating = killerStat.combatRating;
if (victimStat.combatRating < victimStat.lowestCombatRating) killerStat.lowestCombatRating = victimStat.combatRating;
if (killerStat.combatRatingHistory.length > 12) killerStat.combatRatingHistory = killerStat.combatRatingHistory.slice(1); // Remove first element (limits history to length 12)
if (victimStat.combatRatingHistory.length > 12) victimStat.combatRatingHistory = victimStat.combatRatingHistory.slice(1); // Remove first element (limits history to length 12)
if (killerStat.combatRatingHistory.length >= 12) killerStat.combatRatingHistory = killerStat.combatRatingHistory.slice(1); // Remove first element (limits history to length 12)
if (victimStat.combatRatingHistory.length >= 12) victimStat.combatRatingHistory = victimStat.combatRatingHistory.slice(1); // Remove first element (limits history to length 12)
killerStat.combatRatingHistory.push(killerStat.combatRating);
victimStat.combatRatingHistory.push(victimStat.combatRating);
let kdiff = killerStat.combatRating - killerOldRating;