Skip to content

Commit b9ea87e

Browse files
authored
Fix code 3534 (#7057)
* Fixed encumbrance showing up as more than Light * Fixed house rule for load being ignored when applied to AC and movement checks. * Foxed style and removed old print statement
1 parent 6c2f24f commit b9ea87e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

code/src/java/pcgen/cdom/facet/analysis/LoadFacet.java

+13-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
* the terms of the GNU Lesser General Public License as published by the Free
55
* Software Foundation; either version 2.1 of the License, or (at your option)
66
* any later version.
7-
*
7+
*
88
* This program is distributed in the hope that it will be useful, but WITHOUT
99
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1010
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
1111
* details.
12-
*
12+
*
1313
* You should have received a copy of the GNU Lesser General Public License
1414
* along with this library; if not, write to the Free Software Foundation, Inc.,
1515
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -25,6 +25,8 @@
2525
import pcgen.cdom.facet.BonusCheckingFacet;
2626
import pcgen.cdom.facet.FormulaResolvingFacet;
2727
import pcgen.cdom.facet.PlayerCharacterTrackingFacet;
28+
import pcgen.core.Globals;
29+
import pcgen.core.RuleConstants;
2830
import pcgen.core.SettingsHandler;
2931
import pcgen.core.SizeAdjustment;
3032
import pcgen.util.enumeration.Load;
@@ -33,7 +35,7 @@
3335
* LoadFacet calculates information about the Load for a Player Character. The
3436
* underlying Load information used for these calculations is defined in the
3537
* Game Mode LST files.
36-
*
38+
*
3739
*/
3840
public class LoadFacet
3941
{
@@ -46,7 +48,7 @@ public class LoadFacet
4648

4749
/**
4850
* Returns the Load for the Player Character identified by the given CharID.
49-
*
51+
*
5052
* @param id
5153
* The CharID identifying the Player Character for which the Load
5254
* should be returned
@@ -57,6 +59,10 @@ public Load getLoadType(CharID id)
5759
Float weight = totalWeightFacet.getTotalWeight(id);
5860
double dbl = weight / getMaxLoad(id).doubleValue();
5961

62+
if (!Globals.checkRule(RuleConstants.SYS_LDPACSK))
63+
{
64+
return Load.LIGHT;
65+
}
6066
Float lightMult = SettingsHandler.getGameAsProperty().get().getLoadInfo().getLoadMultiplier("LIGHT");
6167
if (lightMult != null && dbl <= lightMult.doubleValue())
6268
{
@@ -81,7 +87,7 @@ public Load getLoadType(CharID id)
8187
/**
8288
* Returns the maximum Load for the Player Character identified by the given
8389
* CharID.
84-
*
90+
*
8591
* @param id
8692
* The CharID identifying the Player Character for which the
8793
* maximum Load should be returned.
@@ -96,7 +102,7 @@ public Float getMaxLoad(CharID id)
96102
/**
97103
* Returns the maximum Load for the Player Character identified by the given
98104
* CharID, multiplied by the given multiplier.
99-
*
105+
*
100106
* @param id
101107
* The CharID identifying the Player Character for which the
102108
* maximum Load should be returned.
@@ -122,7 +128,7 @@ public Float getMaxLoad(CharID id, double mult)
122128
/**
123129
* Returns the Load Multiplier for the size of the Player Character
124130
* identified by the given CharID.
125-
*
131+
*
126132
* @param id
127133
* The CharID identifying the Player Character for which the Load
128134
* Multiplier will be returned.

0 commit comments

Comments
 (0)