Move the removal of the 'distracted' state from SmartAI to UnitAI.cpp. Fixes and closes #7197 and #15482.