From: <jde...@us...> - 2008-03-29 21:04:48
|
Revision: 5748 http://pcgen.svn.sourceforge.net/pcgen/?rev=5748&view=rev Author: jdempsey Date: 2008-03-29 14:04:47 -0700 (Sat, 29 Mar 2008) Log Message: ----------- Fix bug: Scroll with Multiple Spells .CLEAR issues Issue#: 1772054 Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/Equipment.java Modified: Trunk/pcgen/code/src/java/pcgen/core/Equipment.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/Equipment.java 2008-03-29 19:38:28 UTC (rev 5747) +++ Trunk/pcgen/code/src/java/pcgen/core/Equipment.java 2008-03-29 21:04:47 UTC (rev 5748) @@ -2608,8 +2608,9 @@ * The feature to be added to the EqModifier attribute * @param bPrimary * The feature to be added to the EqModifier attribute + * @param isLoading Is the equipment item being loaded currently. */ - public void addEqModifier(final String aString, final boolean bPrimary) { + private void addEqModifier(final String aString, final boolean bPrimary, final boolean isLoading) { final StringTokenizer aTok = new StringTokenizer(aString, "|"); // The type of EqMod, eg: ABILITYPLUS @@ -2655,7 +2656,7 @@ if (eqMod.getChoiceString().length() != 0) { while (aTok.hasMoreTokens()) { final String x = aTok.nextToken(); - if (eqMod.getChoiceString().startsWith("EQBUILDER")) { + if (eqMod.getChoiceString().startsWith("EQBUILDER") && !isLoading) { // We clear the associated info to avoid a buildup of info // like number of charges. eqMod.clearAssociated(); @@ -2832,13 +2833,28 @@ * The feature to be added to the EqModifiers attribute */ public void addEqModifiers(final String aString, final boolean bPrimary) { + addEqModifiers(aString, bPrimary, false); + } + + /** + * Add a list equipment modifiers and their associated information eg: + * Bane|Vermin|Fey.Keen.Vorpal.ABILITYPLUS|CHA=+6 <p/> Adds a feature to the + * EqModifiers attribute of the Equipment object + * + * @param aString + * The feature to be added to the EqModifiers attribute + * @param bPrimary + * The feature to be added to the EqModifiers attribute + * @param isLoading Is the equipment item being loaded currently. + */ + public void addEqModifiers(final String aString, final boolean bPrimary, final boolean isLoading) { final StringTokenizer aTok = new StringTokenizer(aString, "."); while (aTok.hasMoreTokens()) { final String aEqModName = aTok.nextToken(); if (!aEqModName.equalsIgnoreCase(Constants.s_NONE)) { - addEqModifier(aEqModName, bPrimary); + addEqModifier(aEqModName, bPrimary, isLoading); } } @@ -3415,7 +3431,7 @@ } else if (aString.startsWith("SIZE" + endPart)) { newSize = aString.substring(4 + endPartLen); } else if (aString.startsWith("EQMOD" + endPart)) { - addEqModifiers(aString.substring(5 + endPartLen), true); + addEqModifiers(aString.substring(5 + endPartLen), true, true); } else if (aString.startsWith("ALTEQMOD" + endPart)) { addEqModifiers(aString.substring(8 + endPartLen), false); } else if (aString.startsWith("SPROP" + endPart)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |