-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add priv for unrestricted spacecannon use
- Loading branch information
1 parent
2e17eea
commit 863fd6e
Showing
2 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
spacecannon.can_shoot = function(pos) | ||
-- only allow shooting in space | ||
return pos.y > 1000 | ||
spacecannon.can_shoot = function(pos, playername) | ||
local has_unrestricted_priv = playername and minetest.check_player_priv(playername, "spacecannon_unrestricted") | ||
-- only allow shooting in space or with priv | ||
return has_unrestricted_priv or pos.y > 1000 | ||
end |