#198 Fix a crash, step 10

This commit is contained in:
kay27 2022-02-14 06:15:03 +04:00
parent 636be37c85
commit 7e9388b80d
4 changed files with 13 additions and 8 deletions

View File

@ -6,9 +6,8 @@ local pool = {}
local tick = false
minetest.register_on_joinplayer(function(player)
local name
name = player:get_player_name()
minetest.register_on_authplayer(function(name, ip, is_success)
if not is_success then return end
pool[name] = 0
end)

View File

@ -21,11 +21,18 @@ local interact_priv = minetest.registered_privileges.interact
interact_priv.give_to_singleplayer = false
interact_priv.give_to_admin = false
local is_player = mcl_playerplus.is_player
local overlay = mcl_enchanting.overlay
local hud = "mcl_shield_hud.png"
function is_player(obj)
if not obj then return end
if not obj:is_player() then return end
local name = obj:get_player_name()
if not name then return end
if possible_hackers[name] then return end
return true
end
minetest.register_tool("mcl_shields:shield", {
description = S("Shield"),
_doc_items_longdesc = S("A shield is a tool used for protecting the player against attacks."),

View File

@ -1,3 +1,4 @@
name = mcl_player
author = celeron55
description = Adds the 3D player model, taken from Minetest Game 0.4.16.
depends = mcl_shields

View File

@ -27,7 +27,7 @@ local mcl_playerplus_internal = {}
local time = 0
local look_pitch = 0
function mcl_playerplus.is_player(obj)
function is_player(obj)
if not obj then return end
if not obj:is_player() then return end
local name = obj:get_player_name()
@ -36,8 +36,6 @@ function mcl_playerplus.is_player(obj)
return true
end
local is_player = mcl_playerplus.is_player
local function player_collision(player)
local pos = player:get_pos()