Skip to content

Commit 1105a14

Browse files
authoredSep 8, 2017
Particles: Do not add digging particles for airlike nodes (#6392)
1 parent e3093cb commit 1105a14

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed
 

Diff for: ‎src/game.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4032,7 +4032,7 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
40324032

40334033
if (m_cache_enable_particles) {
40344034
const ContentFeatures &features = client->getNodeDefManager()->get(n);
4035-
client->getParticleManager()->addPunchingParticles(client,
4035+
client->getParticleManager()->addNodeParticle(client,
40364036
player, nodepos, n, features);
40374037
}
40384038
}

Diff for: ‎src/particles.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -601,21 +601,23 @@ void ParticleManager::handleParticleEvent(ClientEvent *event, Client *client,
601601
void ParticleManager::addDiggingParticles(IGameDef* gamedef,
602602
LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
603603
{
604+
// No particles for "airlike" nodes
605+
if (f.drawtype == NDT_AIRLIKE)
606+
return;
607+
604608
// set the amount of particles here
605609
for (u16 j = 0; j < 32; j++) {
606610
addNodeParticle(gamedef, player, pos, n, f);
607611
}
608612
}
609613

610-
void ParticleManager::addPunchingParticles(IGameDef* gamedef,
611-
LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
612-
{
613-
addNodeParticle(gamedef, player, pos, n, f);
614-
}
615-
616614
void ParticleManager::addNodeParticle(IGameDef* gamedef,
617615
LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
618616
{
617+
// No particles for "airlike" nodes
618+
if (f.drawtype == NDT_AIRLIKE)
619+
return;
620+
619621
// Texture
620622
u8 texid = myrand_range(0, 5);
621623
const TileLayer &tile = f.tiles[texid].layers[0];

Diff for: ‎src/particles.h

-3
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ friend class ParticleSpawner;
185185
void addDiggingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
186186
const MapNode &n, const ContentFeatures &f);
187187

188-
void addPunchingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
189-
const MapNode &n, const ContentFeatures &f);
190-
191188
void addNodeParticle(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
192189
const MapNode &n, const ContentFeatures &f);
193190

0 commit comments

Comments
 (0)
Please sign in to comment.