- Fixed NPE in getAttackersOf.

This commit is contained in:
Sloth
2013-06-30 08:25:21 +00:00
parent f35d57b534
commit 7620b42bef

View File

@@ -97,6 +97,9 @@ public class Combat {
public final List<Card> getAttackersOf(GameEntity defender) { public final List<Card> getAttackersOf(GameEntity defender) {
List<Card> result = new ArrayList<Card>(); List<Card> result = new ArrayList<Card>();
if (!attackedEntities.containsKey(defender)) {
return result;
}
for(AttackingBand v : attackedEntities.get(defender)) { for(AttackingBand v : attackedEntities.get(defender)) {
result.addAll(v.getAttackers()); result.addAll(v.getAttackers());
} }