Display large player dot on maps for nearby player

This commit is contained in:
Nils Dagsson Moskopp 2022-02-03 02:24:29 +01:00
parent e24a38d864
commit 82a5708144
Signed by untrusted user who does not match committer: erle
GPG Key ID: A3BC671C35191080
3 changed files with 22 additions and 4 deletions

View File

@ -324,18 +324,36 @@ minetest.register_globalstep(function(dtime)
local marker
if pos.x < minp.x then
marker = "mcl_maps_player_dot.png"
if minp.x - pos.x < 256 then
marker = "mcl_maps_player_dot_large.png"
else
marker = "mcl_maps_player_dot.png"
end
pos.x = minp.x
elseif pos.x > maxp.x then
marker = "mcl_maps_player_dot.png"
if pos.x - maxp.x < 256 then
marker = "mcl_maps_player_dot_large.png"
else
marker = "mcl_maps_player_dot.png"
end
pos.x = maxp.x
end
-- we never override the small marker
-- yes, this is a literal corner case
if pos.z < minp.z then
marker = "mcl_maps_player_dot.png"
if minp.z - pos.z < 256 and marker ~= "mcl_maps_player_dot.png" then
marker = "mcl_maps_player_dot_large.png"
else
marker = "mcl_maps_player_dot.png"
end
pos.z = minp.z
elseif pos.z > maxp.z then
marker = "mcl_maps_player_dot.png"
if pos.z - maxp.z < 256 and marker ~= "mcl_maps_player_dot.png" then
marker = "mcl_maps_player_dot_large.png"
else
marker = "mcl_maps_player_dot.png"
end
pos.z = maxp.z
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B