-
Notifications
You must be signed in to change notification settings - Fork 119
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
[fixed] You can't use buttons while stunned anymore #1975
base: master
Are you sure you want to change the base?
[fixed] You can't use buttons while stunned anymore #1975
Conversation
I noticed this old issue #1028 This PR already fixes the issue but the inventory screen would open for 1 tick with each key_inventory press while stunned. Fixes the above-mentioned issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine, will leave this open for discussion for now as it does close #1028, which some people may see as a feature that should not be removed (?)
@@ -1,6 +1,12 @@ | |||
|
|||
#include "KnockedCommon.as"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Push the include up one line
Status
Description
Fixes #1951
Fixes #1028
I first noticed this problem in TDM. I was stunned due to falling from a height but was still able to open a chest without delay. This shouldn't be possible, so...
Preventing the player from showing new buttons
This PR adds a check to
canSeeButtons()
inGenericButtonCommon.as
to see if the player is stunned (= knocked).If the player is stunned, he won't be able to show any blob buttons by using "key_use".
Luckily this seems to work for inventory buttons, too. As far as I understand they are server-handled.
I wasn't able to access inventories after applying this fix.
Removing already existing buttons
Inside
DoKnockedUpdate()
inKnockedCommon.as
, I added:This causes buttons that already existed due to keeping "key_use" pressed to exit while the player is stunned.
Now the player can't manage inventories, change class or use tunnels while stunned anymore.
Tested in offline and online, works as intended.
Steps to Test or Reproduce
Be a knight,
/coins 999
, spawn a knightshop and buy a bunch of waterbombs.Go to a chest, tent, storage or tunnel (when there are at least 2).
Throw a waterbomb above you.
Try to press or keep pressed the
key_use
key in order to show or keep showing buttons for above mentioned blobs, before or after getting hit by the waterbomb.Notice you will be able to show and use buttons while stunned.
After this PR, you won't be able to.