Commits

featheredmelody committed 8c92a76

[Bugfix] Fixed a crash if unit has no spell equipped and was retreating.

  • Participants
  • Parent commits 29b36bd

Comments (0)

Files changed (1)

File Story of a Lost Sky/lostsky/battle/ai_fsm.py

         base_priority = priority_numerator/priority_denominator - distance_weight*((distance_to_destination-max_moves)/max_moves)
 
         # Modifiers for priority
-        if self.target_unit and self.target_unit.spell_actions[self.target_unit.equipped]:
+        if self.target_unit and self.unit.spell_actions[self.unit.equipped] and self.target_unit.spell_actions[self.target_unit.equipped]:
             target_displacement = destination - self.target_unit.location_tile
 
             # Additional priority is given to a certain tile if