aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r--advtrains/wagons.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index efebba8..8e3dd8d 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -415,9 +415,11 @@ function wagon:on_step(dtime)
--checking for environment collisions(a 3x3 cube around the center)
if not gp.recently_collided_with_env then
local collides=false
- for x=-1,1 do
- for y=0,2 do
- for z=-1,1 do
+ local exh = self.extent_h or 1
+ local exv = self.extent_v or 2
+ for x=-exh,exh do
+ for y=0,exv do
+ for z=-exh,exh do
local node=minetest.get_node_or_nil(vector.add(first_pos, {x=x, y=y, z=z}))
if (advtrains.train_collides(node)) then
collides=true