summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2017-09-08 18:39:24 +0200
committerGitHub <noreply@github.com>2017-09-08 18:39:24 +0200
commit1105a14bccefb48a0e264fe19190c39629259338 (patch)
tree15da320d9e44dc4d8461ac4c49b99e0ea4d1fbed
parente3093cbe857cca99b8f090922d6553bae90c3bf8 (diff)
downloadminetest-1105a14bccefb48a0e264fe19190c39629259338.tar.gz
minetest-1105a14bccefb48a0e264fe19190c39629259338.tar.bz2
minetest-1105a14bccefb48a0e264fe19190c39629259338.zip
Particles: Do not add digging particles for airlike nodes (#6392)
-rw-r--r--src/game.cpp2
-rw-r--r--src/particles.cpp14
-rw-r--r--src/particles.h3
3 files changed, 9 insertions, 10 deletions
diff --git a/src/game.cpp b/src/game.cpp
index c9d314fa1..bb1875cf3 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -4032,7 +4032,7 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
if (m_cache_enable_particles) {
const ContentFeatures &features = client->getNodeDefManager()->get(n);
- client->getParticleManager()->addPunchingParticles(client,
+ client->getParticleManager()->addNodeParticle(client,
player, nodepos, n, features);
}
}
diff --git a/src/particles.cpp b/src/particles.cpp
index 4839e45c4..faf8063ed 100644
--- a/src/particles.cpp
+++ b/src/particles.cpp
@@ -601,21 +601,23 @@ void ParticleManager::handleParticleEvent(ClientEvent *event, Client *client,
void ParticleManager::addDiggingParticles(IGameDef* gamedef,
LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
{
+ // No particles for "airlike" nodes
+ if (f.drawtype == NDT_AIRLIKE)
+ return;
+
// set the amount of particles here
for (u16 j = 0; j < 32; j++) {
addNodeParticle(gamedef, player, pos, n, f);
}
}
-void ParticleManager::addPunchingParticles(IGameDef* gamedef,
- LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
-{
- addNodeParticle(gamedef, player, pos, n, f);
-}
-
void ParticleManager::addNodeParticle(IGameDef* gamedef,
LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
{
+ // No particles for "airlike" nodes
+ if (f.drawtype == NDT_AIRLIKE)
+ return;
+
// Texture
u8 texid = myrand_range(0, 5);
const TileLayer &tile = f.tiles[texid].layers[0];
diff --git a/src/particles.h b/src/particles.h
index 195658045..11ccd6218 100644
--- a/src/particles.h
+++ b/src/particles.h
@@ -185,9 +185,6 @@ public:
void addDiggingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
const MapNode &n, const ContentFeatures &f);
- void addPunchingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
- const MapNode &n, const ContentFeatures &f);
-
void addNodeParticle(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
const MapNode &n, const ContentFeatures &f);