Fixed issue with getting items from containers

The method should now work with any container that, even ones that
aren't related to PlayerObject and CreatureObject.
This commit is contained in:
Ziggeh
2014-07-03 06:42:33 +02:00
parent f06d881b20
commit ad92b94731
+2 -3
View File
@@ -730,11 +730,10 @@ public class ObjectService implements INetworkDispatch {
return objectId;
}
public Vector<SWGObject> getItemsInContainerByStfName(CreatureObject creature, String containerName, String stfName) {
public Vector<SWGObject> getItemsInContainerByStfName(CreatureObject creature, long containerId, String stfName) {
Vector<SWGObject> itemList = new Vector<SWGObject>();
SWGObject container = creature.getSlottedObject(containerName);
SWGObject container = getObject(containerId);
container.viewChildren(creature, false, false, (item) -> { if (item.getStfName() == stfName) { itemList.add(item); } });