fix/handle new weapons in weaponStats

This commit is contained in:
SowinskiBraeden committed 2023-11-09 10:20:35 -08:00
1 parent bc0336b47a
commit 3406440a31
3 files changed
+15 -2

No files matched your search

+11
View File
@@ -107,5 +107,16 @@ module.exports = {
timesShotPerBodyPart: copy(BodyParts),
});
return player;
},
// If a new weapon is not in the existing weaponStats, this will add it.
createWeaponStats(player, weapon) {
player.weaponStats[weapon] = {
shotsLanded: 0,
timesShot: 0,
shotsLandedPerBodyPart: copy(BodyParts),
timesShotPerBodyPart: copy(BodyParts),
}
return player;
}
}