mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-03 04:16:19 -04:00
See extended...
- Fixed issue where old item wasn't correctly unequipped when equipping another item of the same type.
This commit is contained in:
@@ -64,6 +64,13 @@ public class EquipmentService implements INetworkDispatch {
|
||||
SWGObject container = actor;
|
||||
|
||||
if (canWear(actor, container, item)) {
|
||||
for (String slotName : container.getSlotNamesForObject(item)) {
|
||||
if (container.getSlottedObject(slotName) != null && !container.getSlotNamesForObject(item).iterator().hasNext()) {
|
||||
container.transferTo(actor, actor.getSlottedObject("inventory"), container.getSlottedObject(slotName));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String template = ((item.getAttachment("customServerTemplate") == null) ? item.getTemplate() : (item.getTemplate().split("shared_")[0] + "shared_" + ((String) item.getAttachment("customServerTemplate")) + ".iff"));
|
||||
String serverTemplate = template.replace(".iff", "");
|
||||
|
||||
@@ -73,13 +80,6 @@ public class EquipmentService implements INetworkDispatch {
|
||||
func.__call__(Py.java2py(core), Py.java2py(actor), Py.java2py(item));
|
||||
}
|
||||
|
||||
for (String slotName : container.getSlotNamesForObject(item)) {
|
||||
if (container.getSlottedObject(slotName) != null && !container.getSlotNamesForObject(item).iterator().hasNext()) {
|
||||
container.transferTo(actor, actor.getSlottedObject("inventory"), item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
actor.addObjectToEquipList(item);
|
||||
processItemAtrributes(actor, item, true);
|
||||
|
||||
@@ -116,7 +116,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
for (String slotName : container.getSlotNamesForObject(item)) {
|
||||
if (container.getSlottedObject(slotName) != null && !container.getSlotNamesForObject(item).iterator().hasNext()) {
|
||||
unequipAppearance(actor, item);
|
||||
container.transferTo(actor, actor.getSlottedObject("inventory"), item);
|
||||
container.transferTo(actor, actor.getSlottedObject("inventory"), container.getSlottedObject(slotName));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user