Skip to content

Commit

Permalink
inventory/windows: Don't use ListContainer.
Browse files Browse the repository at this point in the history
Since we don't need recursion, just use a regular list.
  • Loading branch information
MostAwesomeDude committed Mar 21, 2014
1 parent b8fb345 commit d724cf8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bravo/inventory/windows.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from itertools import chain, izip
from construct import Container, ListContainer
from construct import Container

from bravo import blocks
from bravo.beta.packets import make_packet
Expand Down Expand Up @@ -101,15 +101,15 @@ def load_from_packet(self, container):
self.load_from_list(items)

def save_to_packet(self):
lc = ListContainer()
l = []
for item in chain(*self.metalist):
if item is None:
lc.append(Container(primary=-1))
l.append(Container(primary=-1))
else:
lc.append(Container(primary=item.primary,
l.append(Container(primary=item.primary,
secondary=item.secondary, count=item.quantity))

packet = make_packet("inventory", wid=self.wid, length=len(lc), items=lc)
packet = make_packet("inventory", wid=self.wid, length=len(l), items=l)
return packet

def select_stack(self, container, index):
Expand Down

0 comments on commit d724cf8

Please sign in to comment.