Length check for armor set getters.
This commit is contained in:
parent
4d9f34b5ba
commit
917c02c7da
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -177,9 +177,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -177,9 +177,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -177,9 +177,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -93,13 +93,17 @@ public class ArmorSetData implements IXmlReader
|
||||
|
||||
public boolean setExists(int chestId)
|
||||
{
|
||||
return _armorSets[chestId] != null;
|
||||
return (_armorSets.length >= chestId) && (_armorSets[chestId] != null);
|
||||
}
|
||||
|
||||
public ArmorSet getSet(int chestId)
|
||||
{
|
||||
if (_armorSets.length >= chestId)
|
||||
{
|
||||
return _armorSets[chestId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ArmorSetData getInstance()
|
||||
{
|
||||
|
@ -93,13 +93,17 @@ public class ArmorSetData implements IXmlReader
|
||||
|
||||
public boolean setExists(int chestId)
|
||||
{
|
||||
return _armorSets[chestId] != null;
|
||||
return (_armorSets.length >= chestId) && (_armorSets[chestId] != null);
|
||||
}
|
||||
|
||||
public ArmorSet getSet(int chestId)
|
||||
{
|
||||
if (_armorSets.length >= chestId)
|
||||
{
|
||||
return _armorSets[chestId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ArmorSetData getInstance()
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ public class ArmorSetData implements IXmlReader
|
||||
*/
|
||||
public boolean isArmorSet(int chestId)
|
||||
{
|
||||
return _armorSets[chestId] != null;
|
||||
return (_armorSets.length >= chestId) && (_armorSets[chestId] != null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,9 +185,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the give chest Id.
|
||||
*/
|
||||
public ArmorSet getSet(int chestId)
|
||||
{
|
||||
if (_armorSets.length >= chestId)
|
||||
{
|
||||
return _armorSets[chestId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the single instance of ArmorSetsData.
|
||||
|
@ -176,7 +176,7 @@ public class ArmorSetData implements IXmlReader
|
||||
*/
|
||||
public boolean isArmorSet(int chestId)
|
||||
{
|
||||
return _armorSets[chestId] != null;
|
||||
return (_armorSets.length >= chestId) && (_armorSets[chestId] != null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,9 +185,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the give chest Id.
|
||||
*/
|
||||
public ArmorSet getSet(int chestId)
|
||||
{
|
||||
if (_armorSets.length >= chestId)
|
||||
{
|
||||
return _armorSets[chestId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the single instance of ArmorSetsData.
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -177,9 +177,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -177,9 +177,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -177,9 +177,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
@ -175,9 +175,13 @@ public class ArmorSetData implements IXmlReader
|
||||
* @return the armor set associated to the given item id
|
||||
*/
|
||||
public ArmorSet getSet(int setId)
|
||||
{
|
||||
if (_armorSets.length >= setId)
|
||||
{
|
||||
return _armorSets[setId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId the item id that is attached to a set
|
||||
|
Loading…
Reference in New Issue
Block a user