PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Timed Target Cursor

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Distro Bug Reports
Display posts from previous:   

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Fri Oct 12, 2007 2:42 am    Post subject: Timed Target Cursor Reply with quote

I tried using the TargetEX(who, time); functions and although they work I have some problems.

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:
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


It also appears the program is killed when the timer runs down. Any reason for this? Wouldn't it just be better for the target cursor to cancel and the TargetEX return 0 if it timed out?

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Fri Oct 12, 2007 4:10 am    Post subject: Reply with quote

Fixed by MuadDib in record time.
Fix available in distro SVN now.

Many thanks.

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Fri Oct 12, 2007 4:27 am    Post subject: Reply with quote

NP. Please be sure to do extensive testing and report back in irc or here Smile

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Fri Oct 12, 2007 8:04 am    Post subject: Reply with quote

Yep, I am about to subject my staff to a square meal of TargetEX. This will soon weed out any problems.

As a matter of interest, the way MaudDib explained it, these functions are set up in such a way that it is important to test the function return for errors to avoid the "nnnn used out-of-sequence target cursor" errors. For example:

Code:
var targetted := TargetEX(who, 10);
if ( !targetted or targetted.errortext )
  return 0;
endif


Both TargetEX and TargetCoordinatesEX will now return an error if there is already a target cursor being displayed.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Distro Bug Reports All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty