MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / setSourceEntity

Method setSourceEntity

source/game/StarProjectile.cpp:435–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435void Projectile::setSourceEntity(EntityId source, bool trackSource) {
436 m_sourceEntity = source;
437 m_trackSourceEntity = trackSource;
438 if (inWorld()) {
439 if (auto sourceEntity = world()->entity(source)) {
440 m_lastEntityPosition = sourceEntity->position();
441 if (!m_damageTeam)
442 setTeam(sourceEntity->getTeam());
443 } else {
444 m_sourceEntity = NullEntityId;
445 m_trackSourceEntity = false;
446 }
447 }
448}
449
450float Projectile::powerMultiplier() const {
451 return m_powerMultiplier;

Callers 3

processActionMethod · 0.80
fireTriggeredMethod · 0.80
spawnProjectileMethod · 0.80

Calls 3

entityMethod · 0.45
positionMethod · 0.45
getTeamMethod · 0.45

Tested by

no test coverage detected