Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Particles: Do not add digging particles for airlike nodes (#6392)
  • Loading branch information
SmallJoker committed Sep 8, 2017
1 parent e3093cb commit 1105a14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/game.cpp
Expand Up @@ -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);
}
}
Expand Down
14 changes: 8 additions & 6 deletions src/particles.cpp
Expand Up @@ -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];
Expand Down
3 changes: 0 additions & 3 deletions src/particles.h
Expand Up @@ -185,9 +185,6 @@ friend class ParticleSpawner;
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);

Expand Down

0 comments on commit 1105a14

Please sign in to comment.