Skip to content

Commit

Permalink
[fight] Move staticInit to turn 1
Browse files Browse the repository at this point in the history
  • Loading branch information
5pilow committed Jun 29, 2022
1 parent eb42c25 commit cdfb67f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/leekwars/generator/fight/Fight.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ public void startFight() throws Exception {
var ai = EntityAI.build(this.generator, entity.getAIFile(), entity);
entity.setAI(ai);
ai.getRandom().seed(this.seed);
ai.staticInit();

// Check all entities characteristics
statistics.init(entity);
Expand Down Expand Up @@ -520,6 +519,9 @@ public void startTurn() throws Exception {

if (current.hasValidAI()) {
long startTime = System.nanoTime();
if (order.getTurn() == 1) {
current.getAI().staticInit();
}
current.getAI().runTurn();
long endTime = System.nanoTime();

Expand Down

0 comments on commit cdfb67f

Please sign in to comment.