Code
  1. Code
  2. CODE-1855

Can't equip same weapon to Secondary Hand

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.00.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I'm fixing our test characters - and I have BarJack - he has two daggers. I can't equip them to 1 primary and 1 secondary for two weapon fighting. Instead even if Secondary Hand is selected, the dagger quantity increases by 1 in the primary hand.

        Activity

        Hide
        Andrew Maitland
        added a comment -

        17:20:43.100 SEVERE main EquipmentSetFacadeImpl:316 Could not find parent for Two Weapons for item Dagger at path 0.1.2

        Show
        Andrew Maitland
        added a comment - 17:20:43.100 SEVERE main EquipmentSetFacadeImpl:316 Could not find parent for Two Weapons for item Dagger at path 0.1.2
        Hide
        Andrew Maitland
        added a comment -

        From Dev Group: c.ross.eskridge AT gmail DOT com
        I think I have fixed the bug for CODE-1855, it appears to be a simple logic bug.

        I looked at creating a unit test, but I think it would require fairly extensive restructuring of the existing tests.

        Index: code/src/java/pcgen/gui2/facade/EquipmentSetFacadeImpl.java
        ===================================================================
        — code/src/java/pcgen/gui2/facade/EquipmentSetFacadeImpl.java (revision 18504)
        +++ code/src/java/pcgen/gui2/facade/EquipmentSetFacadeImpl.java (working copy)
        @@ -469,8 +469,9 @@
        if (parent.equals(existing.getParent())
        && existing.getNodeType() == NodeType.EQUIPMENT)
        {
        + //Don't merge the items if they're in different slots
        EquipNodeImpl existingImpl = (EquipNodeImpl) existing;

        • if (equipSlot != null && equipSlot.equals(existingImpl.getSlot()))
          + if (equipSlot != null && !equipSlot.equals(existingImpl.getSlot())) { continue; }

        ------------------------------------

        Show
        Andrew Maitland
        added a comment - From Dev Group: c.ross.eskridge AT gmail DOT com I think I have fixed the bug for CODE-1855 , it appears to be a simple logic bug. I looked at creating a unit test, but I think it would require fairly extensive restructuring of the existing tests. Index: code/src/java/pcgen/gui2/facade/EquipmentSetFacadeImpl.java =================================================================== — code/src/java/pcgen/gui2/facade/EquipmentSetFacadeImpl.java (revision 18504) +++ code/src/java/pcgen/gui2/facade/EquipmentSetFacadeImpl.java (working copy) @@ -469,8 +469,9 @@ if (parent.equals(existing.getParent()) && existing.getNodeType() == NodeType.EQUIPMENT) { + //Don't merge the items if they're in different slots EquipNodeImpl existingImpl = (EquipNodeImpl) existing; if (equipSlot != null && equipSlot.equals(existingImpl.getSlot())) + if (equipSlot != null && !equipSlot.equals(existingImpl.getSlot())) { continue; } ------------------------------------

          People

          • Assignee:
            Unassigned
            Reporter:
            Andrew Maitland
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: