mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix save loading.
https://stackoverflow.com/a/44888113/632035 Pickle can't deal with loading sets (and probably dicts) of objects with custom __hash__ functions that depend on their state because __hash__ can be called before __setstate__. Make the hash function stupider (but still correct) by just relying on the object ID.
This commit is contained in:
parent
738cf1f381
commit
605d8f057f
@ -78,7 +78,7 @@ class FrontLine(MissionTarget):
|
||||
return (self.blue_cp, self.red_cp) == (other.blue_cp, other.red_cp)
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return hash((self.blue_cp, self.red_cp))
|
||||
return hash(id(self))
|
||||
|
||||
def _compute_position(self) -> Point:
|
||||
return self.point_from_a(self._position_distance)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user