From 79c4d0535c125234c75b3c8e53978527f47eedbf Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 27 Mar 2014 19:12:00 +0100 Subject: dynamic size for landrush:showarea landrush:showarea highlights the boundaries of the current protected area but its size was fixed to 16. As the chunk size is configurable the size of landrush:showarea needs to accord with the chunkSize from the config file. --- init.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 7d0cb87..1f58f28 100644 --- a/init.lua +++ b/init.lua @@ -79,9 +79,19 @@ minetest.register_entity("landrush:showarea",{ hp_max = 1, physical = true, weight = 0, - collisionbox = {-8,-8,-8,8,8,8}, + collisionbox = { + landrush.config:get("chunkSize")/-2, + landrush.config:get("chunkSize")/-2, + landrush.config:get("chunkSize")/-2, + landrush.config:get("chunkSize")/2, + landrush.config:get("chunkSize")/2, + landrush.config:get("chunkSize")/2, + }, visual = "mesh", - visual_size = {x=16.1, y=16.1}, + visual_size = { + x=landrush.config:get("chunkSize")+0.1, + y=landrush.config:get("chunkSize")+0.1 + }, mesh = "landrush_showarea.x", textures = {nil, nil, "landrush_showarea.png", "landrush_showarea.png", "landrush_showarea.png", "landrush_showarea.png"}, -- number of required textures depends on visual colors = {}, -- number of required colors depends on visual -- cgit v1.2.3