From dc85644d716776647818a171ba1ccc0162da2d60 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sun, 20 Jun 2021 15:10:48 -0700 Subject: [PATCH] Exclude weapon names and weights from comparisons. Only the class ID matters, and the names sometimes change with new pydcs updates. --- game/data/weapons.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game/data/weapons.py b/game/data/weapons.py index 668cc028..22aa53b9 100644 --- a/game/data/weapons.py +++ b/game/data/weapons.py @@ -4,7 +4,7 @@ import datetime import inspect import logging from collections import defaultdict -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Dict, Iterator, Optional, Set, Tuple, Union, cast from dcs.unitgroup import FlyingGroup @@ -21,8 +21,8 @@ class Weapon: """Wraps a pydcs weapon dict in a hashable type.""" cls_id: str - name: str - weight: int + name: str = field(compare=False) + weight: int = field(compare=False) def available_on(self, date: datetime.date) -> bool: introduction_year = WEAPON_INTRODUCTION_YEARS.get(self)