It is really easy to get a "nnnn used out-of-sequence target cursor" console error if you double click a target.
Also the function itself seems to be buggy: the second half after the return statment can't run can it?
Code: Select all
function TargetEX(mobile, duration:=0, flags := TGTOPT_CHECK_LOS+TGTOPT_NEUTRAL)
if ( duration > 0 )
if ( CInt(TS_GetTimerDuration(mobile, "TargetControl")) > 0 )
// Existing timer... stop it (itll cancel the old target)
TS_LowerDuration(mobile, "TargetControl", -1);
endif
TS_StartTimer(mobile, "TargetControl", duration);
endif
return Target(mobile, flags);
if ( duration > 0 )
if ( CInt(TS_GetTimerDuration(mobile, "TargetControl")) > 0 )
TS_LowerDuration(mobile, "TargetControl", -1);
endif
endif
return 1;
endfunction