mehah / otclient

An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
263 stars 206 forks source link

Walking bug #402

Closed patrykq112 closed 1 year ago

patrykq112 commented 1 year ago

Priority

High

Area

What happened?

I found a walking bug. Occurs when the creature has an item outfit. bug

What OS are you seeing the problem on?

Windows

Code of Conduct

mehah commented 1 year ago

this is totally out of tibia reality and you are mixing isometric with top down.

patrykq112 commented 1 year ago

this is totally out of tibia reality and you are mixing isometric with top down.

It doesn't matter what graphics I use, because it's a bug in the source. Look: image image image image

When we change the outfit to an item then the m_thingType is replaced with that of the item and returns the functions "isGround", "isGroundBorder", "isOnBottom", "isOnTop" of this item.

patrykq112 commented 1 year ago

If someone is looking for a solution to this bug, you should change the function int Thing::getStackPriority() to this:

int Thing::getStackPriority()
{
    if (isCreature())
        return 4;

    if (isGround())
        return 0;

    if (isGroundBorder())
        return 1;

    if (isOnBottom())
        return 2;

    if (isOnTop())
        return 3;

    // common items
    return 5;
}
patrykq112 commented 1 year ago

@mehah Check it out and make changes to the source.

mehah commented 1 year ago

@patrykq112 as you pointed out where the problem could probably be occurring, so it was easier to solve. test and see if it works.

patrykq112 commented 1 year ago

The problem is solved, I close the issue