Skip to content

Commit

Permalink
Correctly count influenced tiles when empire is created at game start.
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-alvarez committed May 14, 2015
1 parent e28bfc2 commit 5c234a0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.galvarez.ttw.model.RevoltSystem;
import com.galvarez.ttw.model.ScoreSystem;
import com.galvarez.ttw.model.SpecialDiscoveriesSystem;
import com.galvarez.ttw.model.components.InfluenceSource;
import com.galvarez.ttw.model.data.Empire;
import com.galvarez.ttw.model.data.SessionSettings;
import com.galvarez.ttw.model.map.GameMap;
Expand Down Expand Up @@ -331,10 +332,13 @@ private Entity createEmpire(String name, Empire empire) {
if (!empire.isComputerControlled())
player = entity;
map.setEntity(entity, x, y);
InfluenceSource source = entity.getComponent(InfluenceSource.class);
source.influencedTiles.add(map.getPositionAt(x, y));
for (MapPosition p : map.getNeighbors(x, y, 1)) {
if (map.isOnMap(p)) {
Influence inf = map.getInfluenceAt(p);
inf.setInfluence(entity, inf.getMaxInfluence());
source.influencedTiles.add(p);
}
}
log.info("Created {} for empire {}", name, empire);
Expand Down

0 comments on commit 5c234a0

Please sign in to comment.