From e010bdeb27f9e3cf8c80c95a8262a43353afb98e Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 10 May 2015 22:34:30 -0400 Subject: [PATCH] pass outlet position to particle handler as a table rather than separate vars --- homedecor/bathroom_sanitation.lua | 8 ++------ homedecor/handlers/water_particles.lua | 6 +++--- homedecor/kitchen_furniture.lua | 4 +--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/homedecor/bathroom_sanitation.lua b/homedecor/bathroom_sanitation.lua index 8c934b9..415e1c8 100644 --- a/homedecor/bathroom_sanitation.lua +++ b/homedecor/bathroom_sanitation.lua @@ -121,9 +121,7 @@ local function taps_on_rightclick(pos, node, clicker) below.name == "homedecor:sink" or below.name == "homedecor:kitchen_cabinet_with_sink" then local particledef = { - outlet_x = 0, - outlet_y = -0.44, - outlet_z = 0.28, + outlet = { x = 0, y = -0.44, z = 0.28 }, velocity_x = { min = -0.1, max = 0.1 }, velocity_y = -0.3, velocity_z = { min = -0.1, max = 0 }, @@ -231,9 +229,7 @@ homedecor.register("shower_head", { local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-2.0, z=pos.z}) if below and below.name == "homedecor:shower_tray" then local particledef = { - outlet_x = 0, - outlet_y = -0.42, - outlet_z = 0.1, + outlet = { x = 0, y = -0.42, z = 0.1 }, velocity_x = { min = -0.15, max = 0.15 }, velocity_y = -2, velocity_z = { min = -0.3, max = 0.1 }, diff --git a/homedecor/handlers/water_particles.lua b/homedecor/handlers/water_particles.lua index 42d363d..a3334b0 100644 --- a/homedecor/handlers/water_particles.lua +++ b/homedecor/handlers/water_particles.lua @@ -39,9 +39,9 @@ function homedecor.start_particle_spawner(pos, node, particledef, soundname) if fdir and fdir < 4 and (not id or id == 0) then - local outletx = particledef.outlet_x - local outlety = particledef.outlet_y - local outletz = particledef.outlet_z + local outletx = particledef.outlet.x + local outlety = particledef.outlet.y + local outletz = particledef.outlet.z local velocityx = particledef.velocity_x local velocityy = particledef.velocity_y local velocityz = particledef.velocity_z diff --git a/homedecor/kitchen_furniture.lua b/homedecor/kitchen_furniture.lua index e583d14..112ca4e 100644 --- a/homedecor/kitchen_furniture.lua +++ b/homedecor/kitchen_furniture.lua @@ -119,9 +119,7 @@ homedecor.register("kitchen_faucet", { below.name == "homedecor:sink" or below.name == "homedecor:kitchen_cabinet_with_sink" then local particledef = { - outlet_x = 0, - outlet_y = -0.19, - outlet_z = 0.13, + outlet = { x = 0, y = -0.19, z = 0.13 }, velocity_x = { min = -0.05, max = 0.05 }, velocity_y = -0.3, velocity_z = { min = -0.1, max = 0 },