From cdfb67fc1ea90461667b133364522ce84da46914 Mon Sep 17 00:00:00 2001
From: Pilow <pierre.laupretre@gmail.com>
Date: Wed, 29 Jun 2022 21:44:33 +0200
Subject: [PATCH] [fight] Move staticInit to turn 1

---
 src/main/java/com/leekwars/generator/fight/Fight.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/com/leekwars/generator/fight/Fight.java b/src/main/java/com/leekwars/generator/fight/Fight.java
index 9878ef9..0f25aa3 100644
--- a/src/main/java/com/leekwars/generator/fight/Fight.java
+++ b/src/main/java/com/leekwars/generator/fight/Fight.java
@@ -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);
@@ -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();