summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax <baddevil@quantentunnel.de>2014-03-27 19:12:00 +0100
committerMax <baddevil@quantentunnel.de>2014-03-27 19:12:00 +0100
commit79c4d0535c125234c75b3c8e53978527f47eedbf (patch)
tree9d0055ffb76178fb0106959013f4422fe6e39b6e
parentc554091b4329a5d8f44a317281e2e19e3c397722 (diff)
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.
-rw-r--r--init.lua14
1 files 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