Skip to content

Commit

Permalink
Add default_factory to player_inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
Gugubo authored and gmjosack committed Dec 1, 2023
1 parent eb7d4c2 commit 72c8cfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modlunky2/mem/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ class Items:
players: Tuple[Optional[Player], ...] = struct_field(
0x08, array(pointer(dc_struct), 4)
)
player_inventory: Tuple[Inventory, ...] = struct_field(0x28, array(dc_struct, 4))
player_inventory: Tuple[Inventory, ...] = struct_field(
0x28, array(dc_struct, 4), default_factory=lambda: (Inventory,) * 4
)


@dataclass(frozen=True)
Expand Down

0 comments on commit 72c8cfa

Please sign in to comment.