Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Player Continues Walking When Client Loses Focus #60
The issue is directly related to the text input area losing focus. It has been addressed before, but was seen as more of a feature at the time.
What happens is, when a player is using a directional key to walk, if the key is not released & the text input area loses focus, the keypress is not flushed & the character will continue walking in that direction indefinitely until focus is regained & direction key is pressed & released again. This was seen as a feature because it allowed players to walk long distances without having to hold down a key. But there are some pitfalls to it is well. It can potentially cause players to lose control in dangerous situations. For example, trying to escape from an enemy. If focus is lost unintentionally, players can lose control of their characters momentarily, causing them to perhaps move into an even more dangerous situation. Another example would be ground spikes. If a player is moving in the direction of harmful ground tiles & the client loses focus, the player may not be able to regain control of his/her character until it has already received damage. I have witnessed situations like this many times, especially in the deathmatch arena.
I believe that with the implementation of the auto-walk feature, which allows players to manually set continuously walking without holding a direction key, this issue should be fixed. I made a FIXME note in a recent commit: 7356677