Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code 3534 #7057

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions code/src/java/pcgen/cdom/facet/analysis/LoadFacet.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Expand All @@ -25,6 +25,8 @@
import pcgen.cdom.facet.BonusCheckingFacet;
import pcgen.cdom.facet.FormulaResolvingFacet;
import pcgen.cdom.facet.PlayerCharacterTrackingFacet;
import pcgen.core.Globals;
import pcgen.core.RuleConstants;
import pcgen.core.SettingsHandler;
import pcgen.core.SizeAdjustment;
import pcgen.util.enumeration.Load;
Expand All @@ -33,7 +35,7 @@
* LoadFacet calculates information about the Load for a Player Character. The
* underlying Load information used for these calculations is defined in the
* Game Mode LST files.
*
*
*/
public class LoadFacet
{
Expand All @@ -46,7 +48,7 @@ public class LoadFacet

/**
* Returns the Load for the Player Character identified by the given CharID.
*
*
* @param id
* The CharID identifying the Player Character for which the Load
* should be returned
Expand All @@ -57,6 +59,10 @@ public Load getLoadType(CharID id)
Float weight = totalWeightFacet.getTotalWeight(id);
double dbl = weight / getMaxLoad(id).doubleValue();

if (!Globals.checkRule(RuleConstants.SYS_LDPACSK))
{
return Load.LIGHT;
}
Float lightMult = SettingsHandler.getGameAsProperty().get().getLoadInfo().getLoadMultiplier("LIGHT");
if (lightMult != null && dbl <= lightMult.doubleValue())
{
Expand All @@ -81,7 +87,7 @@ public Load getLoadType(CharID id)
/**
* Returns the maximum Load for the Player Character identified by the given
* CharID.
*
*
* @param id
* The CharID identifying the Player Character for which the
* maximum Load should be returned.
Expand All @@ -96,7 +102,7 @@ public Float getMaxLoad(CharID id)
/**
* Returns the maximum Load for the Player Character identified by the given
* CharID, multiplied by the given multiplier.
*
*
* @param id
* The CharID identifying the Player Character for which the
* maximum Load should be returned.
Expand All @@ -122,7 +128,7 @@ public Float getMaxLoad(CharID id, double mult)
/**
* Returns the Load Multiplier for the size of the Player Character
* identified by the given CharID.
*
*
* @param id
* The CharID identifying the Player Character for which the Load
* Multiplier will be returned.
Expand Down
Loading