scope AttackTeammate initializer init
	import RegisterPlayerUnitEvent

	function act takes nothing returns nothing
		if IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(GetAttacker())) then
			IssueImmediateOrder(GetAttacker(), "stop")
		end
	end

	function init takes nothing returns nothing
		registerPlayerUnitEvent(EVENT_PLAYER_UNIT_ATTACKED, function act)
	end
endscope
