Skip to content
New issue

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

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

Already on GitHub? # to your account

The ImpossibleHit check makes player fail to hit monster after opening inventory #193

Open
TechYin opened this issue Feb 18, 2022 · 1 comment

Comments

@TechYin
Copy link

TechYin commented Feb 18, 2022

My players reported me an problem: they couldn't hit any monster or animal after opening inventory and shifting items in it, until they use containers such as workbench. Next time they open inventory, the same situation comes back. Monsters and animals can only be re-hitted after the player uses the containers (such as workbench) again. The information reported by the console is: [NC+] Player failed ImpossibleHit: tried to hit an entity while performing another action (Tags: inventoryopen) (VL3).
So How should I do to solve this problem? Should I level up the VL or disable the ImpossibleHit check?

@Lysandr0
Copy link
Member

Lysandr0 commented Mar 4, 2022

Will need to test it.
Unfortunately, clients don't send any event when they open their own inventory, so we have to rely to other, indirect methods to know if the inventory has been opened.
The current implementation will remember the time at which we received an inventory click event, from that point on, NCP will assume the inventory to be opened, until we receive an inventory close event (which the client does send for its own inventory thankfully) or other events that would forcibly close the inventory.
So, plugins that mess with inventory close events can cause troubles here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants