1
0
Fork 0

Don't make sprint particles in liquids

This commit is contained in:
Wuzzy 2020-03-15 08:23:40 +01:00
parent 73dc0a64b5
commit 2569eae5d8
1 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,8 @@ minetest.register_globalstep(function(dtime)
-- Sprint dirt particles -- Sprint dirt particles
local numParticles = math.random(1, 2) local numParticles = math.random(1, 2)
local playerNode = minetest.get_node({x=playerPos["x"], y=playerPos["y"]-1, z=playerPos["z"]}) local playerNode = minetest.get_node({x=playerPos["x"], y=playerPos["y"]-1, z=playerPos["z"]})
if playerNode["name"] ~= "air" then local def = minetest.registered_nodes[playerNode.name]
if def and def.walkable then
for i=1, numParticles, 1 do for i=1, numParticles, 1 do
minetest.add_particle({ minetest.add_particle({
pos = {x=playerPos["x"]+math.random(-1,1)*math.random()/2,y=playerPos["y"]+0.1,z=playerPos["z"]+math.random(-1,1)*math.random()/2}, pos = {x=playerPos["x"]+math.random(-1,1)*math.random()/2,y=playerPos["y"]+0.1,z=playerPos["z"]+math.random(-1,1)*math.random()/2},