Skip to content

Commit

Permalink
Fix island owners can kick any island member
Browse files Browse the repository at this point in the history
- The /is kick command didn't check if the member is on his island, but if the member was a member on his island. This allowed to kick other players from islands without being the owner of the specified island. Fixes this issue: #24
- Replaced <arg-2> with <player>, since it makes more sense to see <player> than <arg-2> on the translation file side.
- Added comments
  • Loading branch information
Abwasserrohr committed Dec 3, 2018
1 parent de1e16a commit be45f63
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SkyBlock/SKYBLOCK.SK/Commands.sk
Expand Up @@ -467,6 +467,11 @@ command /island [<text>] [<text=1>]:
else:
message "%{_prefix}% %{SB::lang::leftis::%{SK::lang::%uuid of player%}%}%"
leaveisland(player, "owner")

# > Argument: "kick"
# > If a player types in /island with the first argument "kick" and the second argument with the player name of the
# > player who should get kicked, then the following code is investigating if the user has an island, is the owner of his island,
# > has a member by that name on his member list and then fire the "leaveisland" function, if the player was found.
else if arg-1 is "kick":
if {SB::player::%uuid of player%::island::border1} is not set:
message "%{_prefix}% %{SB::lang::nois::%{SK::lang::%uuid of player%}%}%"
Expand All @@ -475,7 +480,7 @@ command /island [<text>] [<text=1>]:
if arg-2 is set:
set {_kickplayer} to arg-2 parsed as offline player
set {_uuid} to uuid of {_kickplayer}
set {_loc} to {SB::player::%{_uuid}%::island::bedrock}
set {_loc} to {SB::player::%uuid of player%::island::bedrock}
set {_locx} to x-coord of {_loc}
set {_locy} to y-coord of {_loc}
set {_locz} to z-coord of {_loc}
Expand All @@ -491,7 +496,7 @@ command /island [<text>] [<text=1>]:
leaveisland({_p2}, "member")
stop
set {_a} to {SB::lang::plnotfound::%{SK::lang::%uuid of player%}%}
replace all "<arg-2>" with arg-2 in {_a}
replace all "<player>" with arg-2 in {_a}
message "%{_prefix}% %{_a}%"
else:
set {_a} to {SB::lang::invitetargeterror::%{SK::lang::%uuid of player%}%}
Expand Down

0 comments on commit be45f63

Please sign in to comment.