Description of the Method @param eqMod Description of the Parameter @param bPrimary Description of the Parameter @param pc The PC carrying the item
(final EquipmentModifier eqMod, final boolean bPrimary, PlayerCharacter pc)
| 3221 | * The PC carrying the item |
| 3222 | */ |
| 3223 | public void removeEqModifier(final EquipmentModifier eqMod, final boolean bPrimary, PlayerCharacter pc) |
| 3224 | { |
| 3225 | |
| 3226 | final EquipmentModifier aMod = getEqModifierKeyed(eqMod.getKeyName(), bPrimary); |
| 3227 | |
| 3228 | if (aMod == null) |
| 3229 | { |
| 3230 | return; |
| 3231 | } |
| 3232 | |
| 3233 | // Get a response from user (if one required) |
| 3234 | // Remove the modifier if all associated choices are deleted |
| 3235 | if (!hasAssociations(aMod) || !EquipmentChoiceDriver.getChoice(0, this, aMod, false, pc)) |
| 3236 | { |
| 3237 | EquipmentHead head = getEquipmentHead(bPrimary ? 1 : 2); |
| 3238 | head.removeFromListFor(ListKey.EQMOD, aMod); |
| 3239 | if (bPrimary) |
| 3240 | { |
| 3241 | usePrimaryCache = false; |
| 3242 | } |
| 3243 | else |
| 3244 | { |
| 3245 | useSecondaryCache = false; |
| 3246 | } |
| 3247 | |
| 3248 | restoreEqModsAfterRemove(pc, eqMod, bPrimary, head); |
| 3249 | |
| 3250 | setDirty(true); |
| 3251 | } |
| 3252 | } |
| 3253 | |
| 3254 | /** |
| 3255 | * Add back in modifiers that this one previously removed. |
no test coverage detected