Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Commit

Permalink
fix a bug where the item count was wrong after actions that took or g…
Browse files Browse the repository at this point in the history
…ave items
  • Loading branch information
RobertBlackhart committed Sep 18, 2015
1 parent 59d2312 commit 38778c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/network/server_interop/so_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ findNewSlot(ItemDef item, ImageElement img, int index, {bool update: false}) {
if (!update) {
itemDiv.classes.add("bounce");
}
//remove the bounce class so that it's not still there for a drag and drop event
// remove the bounce class so that it's not still there for a drag and drop event
new Timer(new Duration(seconds: 1), () {
itemDiv.classes.remove("bounce");
});
Expand Down
7 changes: 6 additions & 1 deletion lib/src/network/server_interop/so_street.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ _setupStreetSocket(String streetName) {
}

if (updateNeeded) {
if(!update) {
if(newSlot.count == 0) {
uiSlots.elementAt(i).children.clear();
}
uiSlots.elementAt(i).children.forEach((Element child) {
if(child.attributes.containsKey('count')) {
child.attributes['count'] = "0";
}
});
for (int j = 0; j < newSlot.count; j++) {
addItemToInventory(newSlot.item, i, update:update);
}
Expand Down

0 comments on commit 38778c2

Please sign in to comment.