Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
57 stars 45 forks source link

[Bug (Maybe)] Frame Skipping Problem on Some Clients #1164

Open canerksk opened 11 months ago

canerksk commented 11 months ago

In many clients, when you double-click on a weapon and select an object, the character turns in that direction. When you make a macro of this and keep pressing the macro while running, the character jumps and runs. For this, I added OF_NoDClickTurn_Char in addition to OF_NoTargTurn.

CClientEvent.cpp

under bool CClient::Event_DoubleClick( CUID uid, bool fMacro, bool fTestTouch, bool fScript )


    // Face the object

    // Face the item
    if (pObj->IsItem())
    {
        if (!IsSetOF(OF_NoDClickTurn) && (pObj->GetTopLevelObj() != m_pChar))
        {
            SetTargMode();
            m_Targ_UID = uid;
            m_pChar->UpdateDir(pObj);
        }
    }

    // Face the char
    if (pObj->IsChar())
    {
        if (!IsSetOF(OF_NoDClickTurn_Char) && (pObj->GetTopLevelObj() != m_pChar))
        {
            SetTargMode();
            m_Targ_UID = uid;
            m_pChar->UpdateDir(pObj);
        }
    }
Jhobean commented 11 months ago

Good idea. PR?

canerksk commented 11 months ago

Contributor

Since I don't have git or any compiler ide on my computer right now, I can't make a pull request, so I sent all the changes here as an issue.

raydienull commented 10 months ago

proposal: why not disable double-click rotation as a default in core. Whoever wants to implement this feature, could implement it directly in the script pack.

cbnolok commented 10 months ago

To be honest i'd rather how it is now, in order not to break existing stuff. It can be a good point of discussion for new features and x script pack

Jhobean commented 10 months ago

Actual ini switch about auto rotation is good. I think the proposition of a second ini switch is a good fix.I think Moving all this feature in script is not good idea.

Soulless-1 commented 2 weeks ago

doesnt this ini option already exist to handle this? OF_NoDClickTurn, i believe this has been around for a long time already. i do not turn when dclicking anything at all.

canerksk commented 2 weeks ago

I finally found a solution in my own Fork, if the character is moving (last event walk) it is an update. Because this frame throwing event only happens when moving