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

Add the "Thief" class #1174

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleaned up a little
  • Loading branch information
Infernia829 committed Jul 3, 2023
commit b0351b56cbc89395e39cdf0f2907c29efb6ce956
3 changes: 1 addition & 2 deletions mods/ctf/ctf_modes/ctf_mode_classes/thief.lua
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ local function rob_player(player, robber)
local stack = inv:get_stack("main", math.random(1, inv:get_size("main")))
local mode = ctf_modebase:get_current_mode()
if mode and mode.stuff_provider then
for _, item in ipairs(classes.get(player).items) do
for _, item in ipairs(classes.get(player).items) do
if stack:get_name() == item or stack:get_name() == "" then
return "You didn't find anything to rob."
end
@@ -25,7 +25,6 @@ end

minetest.register_on_punchplayer(function(punched, puncher)
if puncher and puncher:is_player() and punched and punched:is_player() then
local wielded_item = puncher:get_wielded_item()
if puncher:get_wielded_item():get_name() == "" then
if robbery_cooldown:get(puncher:get_player_name()) then
hud_events.new(puncher, {