- Joined
- Nov 2, 2004
- Messages
- 1,993
As in the title. When I do this:
It works perfectly fine, except when right-clicking a friendly unit. Does anyone know why, or how to fix this?
Edit: well, "fixed" it by doing this:
JASS:
private function SquadTargetOrder takes nothing returns nothing
local trigger trg = GetTriggeringTrigger()
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Target: " + OrderId2String(GetIssuedOrderId()))
call DisableTrigger(trg) // Prevent infinite loop
call GroupTargetOrder(UnitGetSquad(GetOrderedUnit()), OrderId2String(GetIssuedOrderId()), GetOrderTarget())
call TriggerSleepAction(0.01)
call EnableTrigger(trg)
set trg = null
endfunction
It works perfectly fine, except when right-clicking a friendly unit. Does anyone know why, or how to fix this?
Edit: well, "fixed" it by doing this:
JASS:
if order == "smart" and targetUnit != null and IsPlayerAlly(GetOwningPlayer(orderedUnit), GetOwningPlayer(targetUnit)) then
call GroupPointOrder(UnitGetSquad(orderedUnit), order, GetUnitX(targetUnit), GetUnitY(targetUnit))
else
call GroupTargetOrder(UnitGetSquad(orderedUnit), order, GetOrderTarget())
endif
Last edited: