Tracking targets out of range

Discussion in 'Bug Reports' started by Rad, Jul 7, 2018.

  1. Rad

    Rad Well-Known Member
    UO:R Donor

    Joined:
    Jul 24, 2017
    Messages:
    455
    Likes Received:
    492
    This is the bug that is allowing people to track harrowers and idocs from the safety of their home. The issue comes from the RunUO server sending the "that is too far away" message even when an item is on the other side of the world. When that item disappears you no longer get the message, so your razor macro can look something like this:

    Code:
    UseItem Dagger
    Absolute Target
    Pause 3.0
    If (sysmessage "too far away")
        // do nothing
    else
        send guild message "item has disappeared"
    end if
    A simple fix for this would be to do away with the "that is too far away" message if you're way too far out of range. This is the RunUO code in Targeting/Target.cs that generates the "too far away" system message:

    Code:
                if ( map == null || map != from.Map || ( m_Range != -1 && !from.InRange( loc, m_Range ) ) )
                {
                    OnTargetOutOfRange( from, targeted );
                }
    
    <snip>
    
            protected virtual void OnTargetOutOfRange( Mobile from, object targeted )
            {
                from.SendLocalizedMessage( 500446 ); // That is too far away.
            }
    
    Here's a simple quick and dirty fix. I'm not a C# developer so maybe @Quick could sanity check this for me. This block of code would go directly above the if (map == null.... line above

    Code:
                if (!Utility.InUpdateRange( loc, m_Range ) )
                {
                    // These next 2 lines may not be necessary, including for telamon to determine
                    OnTargetDeleted( from, targeted );
                    OnTargetFinish( from );
                    return;
                }
    
    Last edited: Jul 7, 2018
    RavenMagi, One, jumpman and 2 others like this.
  2. Quick

    Quick Well-Known Member
    UO:R Subscriber

    Joined:
    Jan 6, 2018
    Messages:
    303
    Likes Received:
    534
    There are probably a few ways to fix it it but you're going down the right path if my understanding of how RunUO and Razor are handling the actions you describe, though the fix is a bit more involved than editing one file.

    To those people with more knowledge about this, I would think the most helpful thing you could do is privately message Telamon and inform him of other ways one can do this so it's ensured its covered at all angles. He's the RunUO expert, not me and since my previous post was misinterpreted and used by folks to fuel existing feuds, it's probably in my best interest to just watch from the sidelines and go back to my little corner of the UO:R world. :)
  3. Rad

    Rad Well-Known Member
    UO:R Donor

    Joined:
    Jul 24, 2017
    Messages:
    455
    Likes Received:
    492
    I've been looking through the runuo source and it doesn't appear in any other locations. It looks like the different messages that map to Cliloc message 500446 are mapped in your client's Cliloc file to give you unique messages for the individual skills that support it.

    This is all from cliloc.enu
    Code:
    500206    That is too far away to ride.
    500251    That location is too far away.
    500295    You are too far away to do that.
    500325    I am too far away to do that.
    500332    I am too far away to do that.
    500348    I am too far away to do that.
    500350    You are too far away to tell much about it.
    500401    You are too far away to beg from him.
    500402    You are too far away to beg from her.
    500403    That's too far away.  You couldn't beg from it anyway.
    500446    That is too far away.
    500486    That is too far away.
    500598    You are too far away from the archery butte to get an accurate shot.
    500602    You are too far away from the archery butte to get an accurate shot.
    500618    That is too far away!
    500643    Target is too far away.
    500890    Oh, but I cannot wander too far from my shop!
    500953    That is too far away.
    501214    That is too far away.
    501416    The map is too far away from me, sir.
    501584    That is too far away.
    501585    That is too far away.
    501816    You are too far away to do that.
    501853    Target is too far away.
    501860    That is too far away.
    501867    You have moved too far away to continue mining.
    501975    That is too far away.
    501976    The ore is too far away.
    502070    I am too far away to do that.
    502138    That is too far away for you to use.
    502390    Thou hast wandered too far from the site of thy resurrection!
    502480    You are too far away from the location at which the ship was docked.
    502481    That location is too far away.
    502487    That location is too far away.
    502514    The map is too far away from me, sir.
    502640    Target is too far away.
    502648    Target is too far away.
    502795    You are too far away to continue taming.
    502803    It's too far away.
    502815    You are too far away to taste that.
    502825    That location is too far away
    503034    That is too far away.
    503041    You have moved too far away to continue mining.
    1005141    DEBUG: I cannot hit because target is too far away
    1014162    Our healer sets to the east side, between the two bridges. If thou seest the inn, thou hast gone too far north.
    1014279    The inn is east a ways from the docks, a bit south. If thou sees the Artists' Guild, thou art too far east. If thou finds the scholar mage's place, thou art too far south.
    1014297    There's but one bank in Nujel'm, and it lies in the southeastern quarter of town, not too far from the human chessboard.
    1014363    We have but one healer, and too far a walk from the training grounds, to my mind. If thou hast wounds, look to the south of the commercial district.
    1019002    You are too far away to use the gate.
    1019044    I am too far away to do that.
    1042482    Target is too far away!
    1076766    That is too far away.
    3000268    That is too far away.
    
    Last edited: Jul 7, 2018
  4. Rad

    Rad Well-Known Member
    UO:R Donor

    Joined:
    Jul 24, 2017
    Messages:
    455
    Likes Received:
    492
    I actually tested this with RunUO most likely a completely different version from UOR but the test should still be relevant. Here's the added code. All I added was the second If block

    Code:
                if ( map == null || map != from.Map || ( m_Range != -1 && !from.InRange( loc, m_Range ) ) )
                {
                    if (Utility.InUpdateRange( loc, from.Location ))  // this line added by rad
                    {
                        OnTargetOutOfRange( from, targeted );  // this line already exists in runuo source
                    }
                }
    
    Here are the results

    This is RunUO unpatched, the current behavior in UOR. As you can see I'm standing 19 tiles away from the Item and using a macro to use Taste ID on the item

    [​IMG]

    This is with RunUO patched

    Standing right next to the item (the shoes on the ground)

    [​IMG]

    Still on screen with the item but too far away to use taste id on it

    [​IMG]

    Just off screen from the item but still in range to get the system message

    [​IMG]

    Out of update range from the item

    [​IMG]
    Last edited: Jul 7, 2018
    Quick and RavenMagi like this.
  5. Quick

    Quick Well-Known Member
    UO:R Subscriber

    Joined:
    Jan 6, 2018
    Messages:
    303
    Likes Received:
    534
    Interesting.

    In my fix, I did the opposite. Personally, I think you should always return the proper "too far away" to the user, regardless if you are truly too far away or if the item doesn't exist. So, if an item that once existed in the world is gone, it will still say you're too far away or whatever. That is true in some deep philosophical level, right? :D

    In your fix, if the item still exists in the world, but you are too far away, you aren't informed about it. I would think you should be.

    Stepping through the code, when the item no longer exists, the targeted object is null. During the check in RunUO, it checks if it's a land target, mobile, etc, etc. At the end when it can't figure (because it no longer exists in the UO world) it out it just cancels and doesn't send a message

    So adding..

    Code:
    OnTargetOutOfRange(from, targeted);
    To the else statement (right above where you put your code @Rad ) in Target.cs will give you that message even if the item doesn't even exist. This way, if you're too far away, you're still notified about it, but if the item doesn't exist, you don't know because you still get the too far away message.

    Though like I said, I'm no RunUO expert so I'll defer to those who are, I'm sure he already has it fixed and doesn't need us haha but in my testing this appears to work but I could be missing a specific use case.
    Last edited: Jul 7, 2018
  6. Rad

    Rad Well-Known Member
    UO:R Donor

    Joined:
    Jul 24, 2017
    Messages:
    455
    Likes Received:
    492
    I'm not partial to one way or the other but I think either way fixes our immediate issue as long as something else that we aren't seeing isn't broken by changes to this area of the code. Thanks for taking the time to look into this.
    RavenMagi and Quick like this.

Share This Page