Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open SOS unless it is in character's backpack, but should be reachable in a container. #4986

Open
Lexshmyr opened this issue Jan 16, 2022 · 0 comments

Comments

@Lexshmyr
Copy link

Lexshmyr commented Jan 16, 2022

Opening an SOS to get the gump is forced to have the SOS in the player's backpack. Nearby containers should be acceptable sources for opening the gump.
Needs change to code for location and cliloc message ("I can't reach that." 1019045). This matches the production message when the target cannot be reached.

These changes happen in the OnDoubleClick method of Scripts/Items/Consumables/SOS.cs

    public override void OnDoubleClick(Mobile from)
    {
        if (from.InRange(GetWorldLocation(), 2) && Movable)
        {
            MessageEntry entry;

            if (m_MessageIndex >= 0 && m_MessageIndex < MessageEntry.Entries.Length)
                entry = MessageEntry.Entries[m_MessageIndex];
            else
                entry = MessageEntry.Entries[m_MessageIndex = Utility.Random(MessageEntry.Entries.Length)];

            from.CloseGump(typeof(MessageGump));
            from.SendGump(new MessageGump(entry, m_TargetMap, m_TargetLocation));
        }
        else
        {
            from.SendLocalizedMessage(1019045); // I can't reach that.
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant