diff --git a/.gitea/issue_template/bug-report.md b/.gitea/issue_template/bug-report.md new file mode 100644 index 00000000..5e7ad54e --- /dev/null +++ b/.gitea/issue_template/bug-report.md @@ -0,0 +1,38 @@ +--- + +name: "Bug Report" +about: "Use this for when something's broken." +labels: + - bug + - unconfirmed + +--- + +##### What happened? + + + +##### What did I expect? + + + +##### How to get it to happen + + +1. +2. +3. + +##### Environment + +Mineclonia Version: + + +Minetest Version: diff --git a/.gitea/issue_template/feature-request.md b/.gitea/issue_template/feature-request.md new file mode 100644 index 00000000..788458c8 --- /dev/null +++ b/.gitea/issue_template/feature-request.md @@ -0,0 +1,22 @@ +--- + +name: "Feature Request" +about: "Mineclonia doesn't do something you need it to" +labels: + - "feature request" + +--- + +##### Problem + + + +##### Solution + + diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md new file mode 100644 index 00000000..a5cd91e9 --- /dev/null +++ b/.gitea/pull_request_template.md @@ -0,0 +1,51 @@ + +##### Problem +TRACKING ISSUE: # + + + +##### Solution + + + +##### Details + + + +##### Testing Steps + + +1. +2. +3. + + + + diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 79221d0e..2a2b88ad 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -57,46 +57,44 @@ local function compute_sphere_rays(radius) local rays = {} local sphere = {} - for i=1, 2 do + local function add_ray(pos) + sphere[minetest.hash_node_position(pos)] = pos + end + + for y = -radius, radius do + for z = -radius, radius do + for x = -radius, 0 do + local d = x * x + y * y + z * z + if d <= radius * radius then + add_ray(vector.new(x, y, z)) + add_ray(vector.new(-x, y, z)) + break + end + end + end + end + + for x = -radius, radius do + for z = -radius, radius do + for y = -radius, 0 do + local d = x * x + y * y + z * z + if d <= radius * radius then + add_ray(vector.new(x, y, z)) + add_ray(vector.new(x, -y, z)) + break + end + end + end + end + + for x = -radius, radius do for y = -radius, radius do - for z = -radius, radius do - for x = -radius, 0, 1 do - local d = x * x + y * y + z * z - if d <= radius * radius then - local pos = { x = x, y = y, z = z } - sphere[minetest.hash_node_position(pos)] = pos - break - end - end - end - end - end - - for i=1,2 do - for x = -radius, radius do - for z = -radius, radius do - for y = -radius, 0, 1 do - local d = x * x + y * y + z * z - if d <= radius * radius then - local pos = { x = x, y = y, z = z } - sphere[minetest.hash_node_position(pos)] = pos - break - end - end - end - end - end - - for i=1,2 do - for x = -radius, radius do - for y = -radius, radius do - for z = -radius, 0, 1 do - local d = x * x + y * y + z * z - if d <= radius * radius then - local pos = { x = x, y = y, z = z } - sphere[minetest.hash_node_position(pos)] = pos - break - end + for z = -radius, 0 do + local d = x * x + y * y + z * z + if d <= radius * radius then + add_ray(vector.new(x, y, z)) + add_ray(vector.new(x, y, -z)) + break end end end @@ -253,12 +251,12 @@ local function trace_explode(pos, strength, raydirs, radius, info, puncher) if collisionbox then -- Create rays from random points in the collision box - local x1 = collisionbox[1] * 2 - local y1 = collisionbox[2] * 2 - local z1 = collisionbox[3] * 2 - local x2 = collisionbox[4] * 2 - local y2 = collisionbox[5] * 2 - local z2 = collisionbox[6] * 2 + local x1 = collisionbox[1] + local y1 = collisionbox[2] + local z1 = collisionbox[3] + local x2 = collisionbox[4] + local y2 = collisionbox[5] + local z2 = collisionbox[6] local x_len = math.abs(x2 - x1) local y_len = math.abs(y2 - y1) local z_len = math.abs(z2 - z1)