MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getParticle

Method getParticle

src/Battlescape/Projectile.cpp:364–372  ·  view source on GitHub ↗

* Gets a particle reference from the projectile surfaces. * @param i Index. * @return Particle id. */

Source from the content-addressed store, hash-verified

362 * @return Particle id.
363 */
364int Projectile::getParticle(int i) const
365{
366 if (_action.weapon->getAmmoItem() && _action.weapon->getAmmoItem()->getRules()->getBulletSprite() != -1)
367 return _action.weapon->getAmmoItem()->getRules()->getBulletSprite() + i;
368 else if (_action.weapon->getRules()->getBulletSprite() == -1)
369 return -1;
370 else
371 return _action.weapon->getRules()->getBulletSprite() + i;
372}
373
374/**
375 * Gets the project tile item.

Callers 1

drawTerrainMethod · 0.80

Calls 3

getBulletSpriteMethod · 0.80
getAmmoItemMethod · 0.45
getRulesMethod · 0.45

Tested by

no test coverage detected