From 8d05655c890f74fda9d0feb11822fa8a65684097 Mon Sep 17 00:00:00 2001 From: Treeku Date: Thu, 3 Jul 2014 02:30:26 +0100 Subject: [PATCH] Fixed size issue with SWGList resetAll --- src/resources/objects/SWGList.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/resources/objects/SWGList.java b/src/resources/objects/SWGList.java index 781a676d..8bc43472 100644 --- a/src/resources/objects/SWGList.java +++ b/src/resources/objects/SWGList.java @@ -317,7 +317,7 @@ public class SWGList implements List, Serializable { public boolean set(List list) { synchronized(objectMutex) { - byte[] newListData = { 0x03 }; + byte[] newListData = { }; if (!list.isEmpty()) { for (E element : list) { @@ -331,9 +331,15 @@ public class SWGList implements List, Serializable { } } + IoBuffer buffer = Delta.createBuffer(3 + newListData.length); + buffer.put((byte) 3); + buffer.put((short) list.size()); + buffer.put(newListData); + newListData = buffer.array(); + this.list = list; - updateCounter++; + updateCounter += list.size(); queue(newListData); return true;