From c284e52963ee78afda8f12bbaf915c55df2eb3d1 Mon Sep 17 00:00:00 2001 From: Paramat Date: Mon, 30 Jul 2018 00:32:18 +0100 Subject: [PATCH] Boats, carts mods: Use 'initial_properties' table --- mods/boats/init.lua | 16 +++++++++------- mods/carts/cart_entity.lua | 14 ++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/mods/boats/init.lua b/mods/boats/init.lua index c6d0e291..00cf7918 100644 --- a/mods/boats/init.lua +++ b/mods/boats/init.lua @@ -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, diff --git a/mods/carts/cart_entity.lua b/mods/carts/cart_entity.lua index 38337dbc..855450da 100644 --- a/mods/carts/cart_entity.lua +++ b/mods/carts/cart_entity.lua @@ -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