Fix ArcContainerObject save_binary and load_json
save_binary called stream.read_dword(value) instead of write_dword, so packing any container raised a TypeError. load_json called super().load_json() without data, so the item base never loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2008697d6c
commit
6a8598f33f
1 file changed
+9
-9
@@ -28,19 +28,19 @@ class ArcContainerObject(ArcItem):
|
||||
|
||||
def save_binary(self, stream: ResStream):
|
||||
super().save_binary(stream)
|
||||
stream.read_dword(self.container_open)
|
||||
stream.read_dword(self.container_locked)
|
||||
stream.read_dword(self.container_locked_rank)
|
||||
stream.read_dword(self.container_barred)
|
||||
stream.read_dword(self.container_barred_rank)
|
||||
stream.read_dword(self.container_trapped)
|
||||
stream.read_dword(self.container_trappe_rank)
|
||||
stream.read_dword(len(self.container_inventory_contents))
|
||||
stream.write_dword(self.container_open)
|
||||
stream.write_dword(self.container_locked)
|
||||
stream.write_dword(self.container_locked_rank)
|
||||
stream.write_dword(self.container_barred)
|
||||
stream.write_dword(self.container_barred_rank)
|
||||
stream.write_dword(self.container_trapped)
|
||||
stream.write_dword(self.container_trappe_rank)
|
||||
stream.write_dword(len(self.container_inventory_contents))
|
||||
for content in self.container_inventory_contents:
|
||||
content.save_binary(stream)
|
||||
|
||||
def load_json(self, data):
|
||||
super().load_json()
|
||||
super().load_json(data)
|
||||
self.container_open = data['container_open']
|
||||
self.container_locked = data['container_locked']
|
||||
self.container_locked_rank = data['container_locked_rank']
|
||||
|
||||
Reference in new issue
Block a user