Override minetest.get_objects_inside_radius()
Overrides minetest.get_objects_inside_radius(), meaning meseconds player detectors and mesecons pressure plates do not activate on cloaked players.
This commit is contained in:
parent
46f70ce01e
commit
514fcdcfaa
11
core.lua
11
core.lua
|
@ -10,6 +10,7 @@ cloaking = {}
|
|||
-- can use them.
|
||||
cloaking.get_connected_players = minetest.get_connected_players
|
||||
cloaking.get_player_by_name = minetest.get_player_by_name
|
||||
cloaking.get_objects_inside_radius = minetest.get_objects_inside_radius
|
||||
cloaking.get_server_status = minetest.get_server_status
|
||||
|
||||
local cloaked_players = {}
|
||||
|
@ -34,6 +35,16 @@ minetest.get_player_by_name = function(player)
|
|||
end
|
||||
end
|
||||
|
||||
minetest.get_objects_inside_radius = function(pos, radius)
|
||||
local objs = {}
|
||||
for _, obj in ipairs(cloaking.get_objects_inside_radius(pos, radius)) do
|
||||
if not cloaked_players[obj:get_player_name()] then
|
||||
table.insert(objs, obj)
|
||||
end
|
||||
end
|
||||
return objs
|
||||
end
|
||||
|
||||
minetest.get_server_status = function()
|
||||
local status = cloaking.get_server_status()
|
||||
status = status:sub(1, status:find('{', 1, true))
|
||||
|
|
Loading…
Reference in New Issue