diff --git a/index.html b/index.html index 58b5a0f..3cddc17 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,11 @@ />
diff --git a/src/10th/Roster.jsx b/src/10th/Roster.jsx index bd9e472..6a09f07 100644 --- a/src/10th/Roster.jsx +++ b/src/10th/Roster.jsx @@ -120,6 +120,25 @@ const Unit = ({ unit, index, catalog, onePerPage, forceRules }) => { } }, []); + const areAllModelsTheSame = (modelStats) => { + if (modelStats.length === 1) return true; + const firstModel = modelStats[0]; + return modelStats.every( + (model) => + model.move === firstModel.move && + model.toughness === firstModel.toughness && + model.save === firstModel.save && + model.wounds === firstModel.wounds && + model.leadership === firstModel.leadership && + model.oc === firstModel.oc && + model.bs === firstModel.bs && + model.ws === firstModel.ws && + model.attacks === firstModel.attacks + ); + }; + if (areAllModelsTheSame(modelStats)) { + modelStats = [modelStats[0]]; + } return (