_Object = _this select 0
_vektor = _this select 1

; Get the number of waypoints
_index = 0
_numEl = count _vektor

#Update
; Order the unit to move
_Object move GetMarkerPos (_vektor select _index)

; Has the unit reached the marker?
@UnitReady _Object

; Lay a mine!
_Object Fire ["Put","Mine"]

_index = _index + 1
? (_index < _numEl) : goto "Update"
exit