diff options
author | orwell96 <orwell@bleipb.de> | 2017-11-23 17:00:39 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2017-11-23 17:00:39 +0100 |
commit | d78d07589d31db62167eafafb36b9e8c0468c6d1 (patch) | |
tree | abc9647e10c9f27d311b179a6d02871c1658097c /advtrains/wagons.lua | |
parent | 5fc6cc7f5b7125e470e0e24e4da639f868476dc3 (diff) | |
download | advtrains-d78d07589d31db62167eafafb36b9e8c0468c6d1.tar.gz advtrains-d78d07589d31db62167eafafb36b9e8c0468c6d1.tar.bz2 advtrains-d78d07589d31db62167eafafb36b9e8c0468c6d1.zip |
Add modifiable wagon extents
This will be required for advcarts
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r-- | advtrains/wagons.lua | 8 |
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
|