MultiSellEntry.java have problem
Page 1 of 1 • Share
MultiSellEntry.java have problem
It handling incorrect chance, and heavy
I revised this
I revised this
- Code:
public List<MultiSellIngredient> getProduction(boolean isNew)
{
if (isNew)
{
MultiSellIngredient req = null;
int max = 0;
loop: for (int i = 0; i < _production.size(); i++)
{
if ((req == null))
{
if (Rnd.chance(_production.get(i).getChance()))
{
req = _production.get(i);
}
else if (_production.get(max).getChance() < _production.get(i).getChance())
{
max = i;
}
}
else
{
break loop;
}
}
if (req == null)
{
req = _production.get(max);
}
List<MultiSellIngredient> rqa = new ArrayList<>(1);
rqa.add(req);
return rqa;
}
return _production;
}
lineageno1- Vassal
- Posts : 1
Join date : 2014-11-24
Similar topics
» Problems with HardSpawner.java and SpawnTemplate.java
» Java 1.8 Support
» Looking for Java developers
» Summon problem?
» External IP Problem
» Java 1.8 Support
» Looking for Java developers
» Summon problem?
» External IP Problem
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|