From 38778c2127d58748de105f4e9503fe3b49d92a3b Mon Sep 17 00:00:00 2001 From: Robert McDermot Date: Thu, 17 Sep 2015 21:26:17 -0400 Subject: [PATCH] fix a bug where the item count was wrong after actions that took or gave items --- lib/src/network/server_interop/so_item.dart | 2 +- lib/src/network/server_interop/so_street.dart | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/src/network/server_interop/so_item.dart b/lib/src/network/server_interop/so_item.dart index 5cdae26c..f1c8f962 100644 --- a/lib/src/network/server_interop/so_item.dart +++ b/lib/src/network/server_interop/so_item.dart @@ -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"); }); diff --git a/lib/src/network/server_interop/so_street.dart b/lib/src/network/server_interop/so_street.dart index b8682345..bfe73378 100644 --- a/lib/src/network/server_interop/so_street.dart +++ b/lib/src/network/server_interop/so_street.dart @@ -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); }