Core: downgrade item classification to int before writing to file
This commit is contained in:
parent
b86ee20f3f
commit
26c027a075
|
@ -1150,7 +1150,7 @@ class ItemClassification(IntFlag):
|
||||||
|
|
||||||
def as_flag(self) -> int:
|
def as_flag(self) -> int:
|
||||||
"""As Network API flag int."""
|
"""As Network API flag int."""
|
||||||
return self & 0b0111
|
return int(self & 0b0111)
|
||||||
|
|
||||||
|
|
||||||
class Item:
|
class Item:
|
||||||
|
@ -1207,10 +1207,7 @@ class Item:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def flags(self) -> int:
|
def flags(self) -> int:
|
||||||
new = self.classification.as_flag()
|
return self.classification.as_flag()
|
||||||
old = self.advancement + (self.useful << 1) + (self.trap << 2)
|
|
||||||
assert new == old
|
|
||||||
return new
|
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return self.name == other.name and self.player == other.player
|
return self.name == other.name and self.player == other.player
|
||||||
|
|
Loading…
Reference in New Issue