Ensure tree icons do not touch

This commit is contained in:
Nils Dagsson Moskopp 2022-05-19 03:46:40 +02:00
parent 0ac4ce19fd
commit 5ccfcd922d
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 22 additions and 18 deletions

View File

@ -188,9 +188,10 @@ maps.create_map = function(pos, player_name)
node.name,
"tree"
) > 0 ) and (
z < size - 6 and
x > 3 and
x < size - 3
z > 1 and
z < size - 7 and
x > 4 and
x < size - 4
)
if draw_tree then
local tree = {}
@ -199,29 +200,32 @@ maps.create_map = function(pos, player_name)
local F = { 8 } -- filling
if nil ~= node.name:find("pine") then
tree = {
{ _, _, O, _, _ },
{ O, O, O, O, O },
{ O, F, F, F, O },
{ _, O, F, O, _ },
{ _, O, F, O, _ },
{ _, _, O, _, _ },
{ _, _, _, _, _, _, _ },
{ _, _, _, O, _, _, _ },
{ _, O, O, O, O, O, _ },
{ _, O, F, F, F, O, _ },
{ _, _, O, F, O, _, _ },
{ _, _, O, F, O, _, _ },
{ _, _, _, O, _, _, _ },
{ _, _, _, _, _, _, _ },
}
else
tree = {
{ _, _, O, _, _ },
{ _, _, O, _, _ },
{ _, O, O, O, _ },
{ O, F, F, F, O },
{ O, F, F, F, O },
{ O, F, F, F, O },
{ _, O, O, O, _ },
{ _, _, _, _, _, _, _ },
{ _, _, _, O, _, _, _ },
{ _, _, _, O, _, _, _ },
{ _, _, O, O, O, _, _ },
{ _, O, F, F, F, O, _ },
{ _, O, F, F, F, O, _ },
{ _, _, O, O, O, _, _ },
{ _, _, _, _, _, _, _ },
}
end
image:blit_icon(
tree,
{
x = x - 3,
z = z
x = x - 4,
z = z - 1,
},
{
[3] = true,