Stream removal from skill checkConditions method.

This commit is contained in:
MobiusDevelopment
2021-10-28 21:36:06 +00:00
parent 8fdb4899ac
commit ce683c2938
19 changed files with 285 additions and 19 deletions

View File

@@ -1514,7 +1514,21 @@ public class Skill implements IIdentifiable
*/
public boolean checkConditions(SkillConditionScope skillConditionScope, Creature caster, WorldObject target)
{
return _conditionLists.getOrDefault(skillConditionScope, Collections.emptyList()).stream().allMatch(c -> c.canUse(caster, this, target));
final List<ISkillCondition> conditions = _conditionLists.get(skillConditionScope);
if (conditions == null)
{
return true;
}
for (ISkillCondition condition : conditions)
{
if (!condition.canUse(caster, this, target))
{
return false;
}
}
return true;
}
@Override