mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-02 03:15:52 -04:00
Fixed a bug where you could not remove a lightsaber's color crystal
This commit is contained in:
@@ -123,6 +123,8 @@ public class EquipmentService implements INetworkDispatch {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(item.getTemplate().startsWith("object/weapon/") && item.getTemplate().contains("lightsaber") && item.getAttachment("hasColorCrystal") == null) item.setAttachment("hasColorCrystal", false);
|
||||
|
||||
if(item.getAttachment("hasColorCrystal") != null && (Boolean) item.getAttachment("hasColorCrystal") == false)
|
||||
{
|
||||
actor.sendSystemMessage("You may not equip a light saber that has no color crystal!", (byte) 0);
|
||||
@@ -320,7 +322,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
|
||||
if(!item.getTemplate().startsWith("object/tangible/component/weapon/lightsaber/")) return;
|
||||
if(lightsaber.getAttachment("hasColorCrystal") == null) lightsaber.setAttachment("hasColorCrystal", false);
|
||||
if(item.getAttributes().containsKey("@obj_attr_n:color") && (Boolean) lightsaber.getAttachment("hasColorCrystal")) return;
|
||||
if(item.getAttributes().containsKey("@obj_attr_n:color") && (Boolean) lightsaber.getAttachment("hasColorCrystal") && !(targetContainer.getContainer() instanceof CreatureObject)) return;
|
||||
|
||||
// Find our tuner
|
||||
if(item.getAttachment("tunerId") == null) item.setAttachment("tunerId", 0);
|
||||
@@ -335,6 +337,8 @@ public class EquipmentService implements INetworkDispatch {
|
||||
else item.getContainer().transferTo(actor, targetContainer, item);
|
||||
|
||||
// Calculate attributes
|
||||
lightsaber.setAttachment("hasColorCrystal", false);
|
||||
|
||||
lightsaberInventory.viewChildren(lightsaberInventory, false, false, new Traverser()
|
||||
{
|
||||
WeaponObject saber;
|
||||
@@ -342,7 +346,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
|
||||
int minDamageBonus = 0;
|
||||
int maxDamageBonus = 0;
|
||||
Boolean hasColorCrystal = false;
|
||||
Boolean hasColorCrystal = false;
|
||||
|
||||
public void process(SWGObject item)
|
||||
{
|
||||
@@ -359,10 +363,10 @@ public class EquipmentService implements INetworkDispatch {
|
||||
saber.setCustomizationVariable("private/alternate_shader_blade", bladeType);
|
||||
saber.setCustomizationVariable("/private/index_color_blade", bladeColor);
|
||||
|
||||
// System.out.println("bladeColorName: " + item.getAttributes().get("@obj_attr_n:color"));
|
||||
// System.out.println("bladeColor: " + bladeColor);
|
||||
// System.out.println("bladeType: " + bladeType);
|
||||
// System.out.println();
|
||||
// System.out.println("bladeColorName: " + item.getAttributes().get("@obj_attr_n:color"));
|
||||
// System.out.println("bladeColor: " + bladeColor);
|
||||
// System.out.println("bladeType: " + bladeType);
|
||||
// System.out.println();
|
||||
|
||||
hasColorCrystal = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user