-
Notifications
You must be signed in to change notification settings - Fork 399
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
Game::useWith improper behavior #877
Labels
Comments
I found the same issue when trying to lock a open, unlocked door. When using the key with the door the client will "target" the ground below the open door instead which obviously does not work. Have you found any downsides to your solution so far or would you say it's save to use? |
Probably a duplicate of #644 |
Can you check #1113 ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello. Having on map ground tile (for example dirt ID:351), border (for example grass ID:4543) and nature item (for example frostbite herb ID:7261) and when using on tile kitchen knife or any other item which have "use with" option, returns border item instead item on top of tile.
Steps to reproduce
Expected behaviour
Item is used on nature item which is on top of a tile.
Actual behaviour
Item is used on border item which isn't on top of a tile.
Environment
Bug exists on master branch, tested with TFS and compiled OTClient from latest sources.
Trying to find the problem by myself I have found that using one item on another triggers
g_game.useWith(selectedThing, tile:getTopMultiUseThing())
from https://github.com/edubart/otclient/blob/master/modules/game_interface/gameinterface.lua#L368 whileThingPtr Tile::getTopMultiUseThing()
from https://github.com/edubart/otclient/blob/master/src/client/tile.cpp#L475 iterates by tile things from stackpos 0 up to end of items. When iterating, border item matches!thing->isGround() && !thing->isOnTop()
from https://github.com/edubart/otclient/blob/master/src/client/tile.cpp#L500 returning that thing, not checking rest of items on tile.My workaround was to reverse loop in that way
which solved my issue, but I'm not sure if it won't break anything else, that's why I'm creating this issue.
The text was updated successfully, but these errors were encountered: