Browse Source

fix ant default mode

Bastien Sevajol 8 years ago
parent
commit
8bf9a21f0f

+ 3 - 1
intelligine/simulation/object/brain/part/transport/AntPutBrainPart.py View File

@@ -1,3 +1,4 @@
1
+from intelligine.synergy.object.Food import Food
1 2
 from synergine.core.Core import Core
2 3
 from intelligine.core.exceptions import CantFindWhereToPut
3 4
 from intelligine.cst import MODE_EXPLO, TYPE_RESOURCE_EXPLOITABLE, CARRIED, MODE_NURSE, TYPE_NURSERY, \
@@ -65,4 +66,5 @@ class AntPutBrainPart(TransportBrainPart):
65 66
 
66 67
     def done(self, puted_object):
67 68
         # TODO: lancer le choix d'un nouveau mode dans le brain.
68
-        self._host.get_brain().switch_to_mode(MODE_EXPLO)
69
+        if isinstance(puted_object, Food):
70
+            self._host.get_brain().switch_to_mode(MODE_EXPLO)

+ 1 - 0
intelligine/synergy/object/ant/Ant.py View File

@@ -22,6 +22,7 @@ class Ant(Bug):
22 22
                                                            COL_TRANSPORTER_NOT_CARRYING,
23 23
                                                            COL_FIGHTER])
24 24
         self._carried = None
25
+        #  TODO: Comme pour lorsque une action put est faite, lancer un algo de choix de la mission a suivre.
25 26
         self._brain.switch_to_mode(MODE_EXPLO)
26 27
         context.metas.list.add(TYPE, self.get_id(), TYPE_ANT)
27 28