Skip to content

Commit

Permalink
Fix items where .equals would have always failed. (#5179)
Browse files Browse the repository at this point in the history
Conflicts:
	code/src/java/pcgen/gui2/facade/CharacterUtils.java
	code/src/java/pcgen/io/ExportHandler.java
  • Loading branch information
thpr authored Jan 28, 2019
1 parent 99413d3 commit fe46ffd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion code/src/java/pcgen/core/Equipment.java
Original file line number Diff line number Diff line change
Expand Up @@ -3042,7 +3042,7 @@ public void setToCustomSize(PlayerCharacter pc)
if (csr != null)
{
SizeAdjustment customSize = csr.get();
if (!getSafe(ObjectKey.SIZE).equals(customSize))
if (!getSafe(ObjectKey.SIZE).get().equals(customSize))
{
resizeItem(pc, customSize);
}
Expand Down
4 changes: 2 additions & 2 deletions code/src/java/pcgen/core/analysis/AttackInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public static String getAttackInfo(PlayerCharacter pc, AttackType attackType, St
{
if (modifier.equals("TOTAL"))
{
if (attackType.equals("RANGED"))
if (attackType.equals(AttackType.RANGED))
{
int total = getTotalToken(pc, attackType);
return pc.getAttackString(AttackType.RANGED, total);
}
else if (attackType.equals("UNARMED"))
else if (attackType.equals(AttackType.UNARMED))
{
int total = getTotalToken(pc, AttackType.MELEE);
// TODO: Is this correct for 3.0 also?
Expand Down
2 changes: 1 addition & 1 deletion code/src/java/pcgen/gui2/facade/CharacterUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static void selectClothes(final PlayerCharacter aPC)
//
// Need to resize to fit?
//
if (!pcSizeAdj.equals(eq.getSafe(ObjectKey.SIZE)))
if (!pcSizeAdj.equals(eq.getSafe(ObjectKey.SIZE).get()))
{
eq.resizeItem(aPC, pcSizeAdj);
}
Expand Down
11 changes: 6 additions & 5 deletions code/src/java/pcgen/io/ExportHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.Version;
import pcgen.cdom.base.CDOMObject;
import pcgen.cdom.base.Constants;
import pcgen.cdom.enumeration.ListKey;
Expand Down Expand Up @@ -93,6 +88,12 @@
import pcgen.util.Logging;
import pcgen.util.enumeration.View;

import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.Version;

/**
* This class deals with exporting a PC to various types of output sheets
* including XML, HTML, PDF and Text.
Expand Down

0 comments on commit fe46ffd

Please sign in to comment.