Skip to content

Commit

Permalink
Boats, carts mods: Use 'initial_properties' table
Browse files Browse the repository at this point in the history
  • Loading branch information
paramat authored Jul 29, 2018
1 parent ab49405 commit c284e52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
16 changes: 9 additions & 7 deletions mods/boats/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ end
--

local boat = {
physical = true,
-- Warning: Do not change the position of the collisionbox top surface,
-- lowering it causes the boat to fall through the world if underwater
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "boats_boat.obj",
textures = {"default_wood.png"},
initial_properties = {
physical = true,
-- Warning: Do not change the position of the collisionbox top surface,
-- lowering it causes the boat to fall through the world if underwater
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "boats_boat.obj",
textures = {"default_wood.png"},
},

driver = nil,
v = 0,
Expand Down
14 changes: 8 additions & 6 deletions mods/carts/cart_entity.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
local cart_entity = {
physical = false, -- otherwise going uphill breaks
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "mesh",
mesh = "carts_cart.b3d",
visual_size = {x=1, y=1},
textures = {"carts_cart.png"},
initial_properties = {
physical = false, -- otherwise going uphill breaks
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "mesh",
mesh = "carts_cart.b3d",
visual_size = {x=1, y=1},
textures = {"carts_cart.png"},
},

driver = nil,
punched = false, -- used to re-send velocity and position
Expand Down

0 comments on commit c284e52

Please sign in to comment.