Skip to content
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

If pkonly is disabled, then players without canbehead could still behead other players. (original 3.x behavior) #6

Closed
crashdemons opened this issue Sep 10, 2018 · 3 comments
Labels
original plugin behavior Concerns pre-existing plugin behavior (before 3.x branch)

Comments

@crashdemons
Copy link
Owner

From the original code:

        if (plugin.configFile.getBoolean("pkonly") && ((killer == null) || (killer == player) || !killer.hasPermission("playerheads.canbehead"))) {
            return;
        }

So if pkonly is disabled, then a player can behead regardless of their permission - is this supposed to be intended behavior?

@crashdemons crashdemons changed the title If pkonly is disabled, then players without canbehead could still behead other players. If pkonly is disabled, then players without canbehead could still behead other players. (original 3.x behavior) Sep 13, 2018
@crashdemons
Copy link
Owner Author

crashdemons commented Sep 13, 2018

On 4.x, this is changed by 7ffb589, 50f613b, 0f9aca7 but I need to test it.

On 3.x this is unchanged so far

@crashdemons
Copy link
Owner Author

Analysis of the behavior changes:
https://gist.github.com/crashdemons/b7fd9f11b6087eaed2a30f518b1fc96c (dropchancegood should be called dropchancebad)

from this we can see only the following changes occur to behavior:

  • PK on target that has canlosehead, killer does not have canbehead. (good dropchance, pkonly disabled)
    & Same situation but killer has alwaysbehead (no effect to either)
    & Same situation but dropchance rolled bad and killer has alwaysbehead (no effect to either)

    • Old behavior: drop head. [no pkonly allows killer to get a head]
    • New behavior: none. [Killer also needs canbehead to get a head]
  • Selfkill (non-PK) with canlosehead (good dropchance, pkonly disabled)
    & Same situation except player has alwaysbehead (no effect to either)
    & same situation except drop chance rolled bad and player had alwaysbehead (no effect to either)

    • old behavior: drop head. [no pkonly allows killer to get a head]
    • New behavior: none. [killer also needs canbehead to get a head]

So the only side-effect to this change is that the canbehead permission is enforced for killers regardless of other conditions.

crashdemons added a commit that referenced this issue Sep 13, 2018
@crashdemons
Copy link
Owner Author

Fixed in 4.2.2-alpha release. Orginal behavior is kept in 3.12-shimmed1.13

@crashdemons crashdemons added the original plugin behavior Concerns pre-existing plugin behavior (before 3.x branch) label Sep 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
original plugin behavior Concerns pre-existing plugin behavior (before 3.x branch)
Projects
None yet
Development

No branches or pull requests

1 participant