Index: team/macro.h
===================================================================
--- team/macro.h        (révision 4469)
+++ team/macro.h        (copie de travail)
@@ -42,9 +42,9 @@
    FOR_EACH_LIVING_AND_DEAD_CHARACTER(team,character) \
    if (!character -> IsGhost())

-#define FOR_EACH_LIVING_CHARACTER(team,character) \
+#define FOR_EACH_LIVING_CHARACTER(team,character)    \
    FOR_EACH_LIVING_AND_DEAD_CHARACTER(team,character) \
-  if (!character -> IsDead())
+       if (!character -> IsDead())

  #define FOR_ALL_LIVING_AND_DEAD_CHARACTER(team, character) \
    FOR_EACH_TEAM(team) \
@@ -58,10 +58,10 @@
    FOR_EACH_TEAM(team) \
    FOR_EACH_LIVING_CHARACTER(*team,character)

-#define FOR_ALL_LIVING_ENEMIES(shooter,team,character) \
-  FOR_EACH_TEAM(team) \
-  if (!(*team)->IsSameAs(shooter.GetTeam())) \
-  FOR_EACH_LIVING_CHARACTER(*team,character)
+#define FOR_ALL_LIVING_ENEMIES(shooter,team,character) \
+  FOR_EACH_TEAM(team)                                  \
+       if (!(*team)->IsSameAs(shooter.GetTeam()))      \
+               FOR_EACH_LIVING_CHARACTER(*team,character)

 
//-----------------------------------------------------------------------------
  #endif
Index: ai/ai_shoot_module.cpp
===================================================================
--- ai/ai_shoot_module.cpp      (révision 4469)
+++ ai/ai_shoot_module.cpp      (copie de travail)
@@ -350,8 +350,7 @@
    }

    m_current_time = current_time;
-
-  FindEnemy();
+  m_enemy = FindEnemy();
    ChooseDirection();

    switch (m_current_strategy) {
@@ -373,6 +372,8 @@
                }
                 m_enemy = &(*character);
                 Shoot();
+              // If IA selected ProximityWeapon, he needs to go back, in the 
opposite direction (otherwises BOOM  :-)  )
+        
ActiveCharacter().SetDirection((ActiveCharacter().GetDirection()) == 
DIRECTION_RIGHT ? DIRECTION_LEFT : DIRECTION_RIGHT;);
        }
      }
      break;


_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à