The mechanics of your spell is a contradiction, why ?
Okay, here it is,
When we are doing "charge-like" spell or "move-to-target-position" kind of spell, not instant spell, but moving the unit to that location, we need either this action;
-
Unit - Move Caster instantly to TempLoc2
Or this function;
call SetUnitX(udg_Caster, GetLocationX(udg_TempLoc2))
call SetUnitY(udg_Caster, GetLocationY(udg_TempLoc2))
When we want to move unit
and can receive orders at a time, we use the second method, the SetUnitX/Y, because that function
does not interrupt orders, compared to MoveUnit function, you can't do anything at all (can't receive any other orders)
So next, you want that unit to move + receive orders + can't change direction.
Since we have accomplished the move + receive orders, we only need to do something about "can't change direction".
Now, if you want unit that won't be able to change their direction while moving, you're gonna have to issue a 'Stop' order to that unit per interval;
-
Untitled Trigger 004
-
Events
-
Time - Every 0.03 seconds of game time
-
Conditions
-
Actions
-
Unit - Order Caster to Stop
This way, that unit won't be able to change directions no matter how fast you order it to Move.
Since you have issued that unit a 'Stop' order, how do you expect that unit to receive an order to cast spell or attack ?
And if you removed the 'Stop' order method, Player can order that unit to move to any directions he want while during the spell and can cause the unit to end up at different location.