mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-29 22:11:10 +01:00
Merge pull request 'Fix insane enderman 64 node radius check for players' (#1479) from jordan4ibanez/MineClone2-MobTweaks:master into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/1479
This commit is contained in:
commit
4ec3fd0ba6
1 changed files with 22 additions and 29 deletions
|
@ -328,12 +328,7 @@ mobs:register_mob("mobs_mc:enderman", {
|
||||||
--end
|
--end
|
||||||
end
|
end
|
||||||
-- Check to see if people are near by enough to look at us.
|
-- Check to see if people are near by enough to look at us.
|
||||||
local objs = minetest.get_objects_inside_radius(enderpos, 64)
|
for _,obj in pairs(minetest.get_connected_players()) do
|
||||||
local obj
|
|
||||||
for n = 1, #objs do
|
|
||||||
obj = objs[n]
|
|
||||||
if obj then
|
|
||||||
if minetest.is_player(obj) then
|
|
||||||
-- Check if they are looking at us.
|
-- Check if they are looking at us.
|
||||||
local player_pos = obj:get_pos()
|
local player_pos = obj:get_pos()
|
||||||
local look_dir_not_normalized = obj:get_look_dir()
|
local look_dir_not_normalized = obj:get_look_dir()
|
||||||
|
@ -359,8 +354,6 @@ mobs:register_mob("mobs_mc:enderman", {
|
||||||
look_pos.z = look_pos.z + (.25 * look_dir.z)
|
look_pos.z = look_pos.z + (.25 * look_dir.z)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
-- TAKE AND PLACE STUFF BEHAVIOUR BELOW.
|
-- TAKE AND PLACE STUFF BEHAVIOUR BELOW.
|
||||||
if not mobs_griefing then
|
if not mobs_griefing then
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue