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

Method damageSources

source/game/StarVehicle.cpp:519–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519List<DamageSource> Vehicle::damageSources() const {
520 List<DamageSource> sources;
521 for (auto const& p : m_damageSources) {
522 if (p.second.enabled.get()) {
523 DamageSource damageSource = p.second.damageSource;
524
525 if (p.second.attachToPart) {
526 Mat3F partTransformation = m_networkedAnimator.finalPartTransformation(p.second.attachToPart.get());
527 damageSource.damageArea.call([partTransformation](auto& da) { da.transform(partTransformation); });
528 }
529
530 damageSource.team = m_damageTeam.get();
531 damageSource.sourceEntityId = entityId();
532
533 sources.append(std::move(damageSource));
534 }
535 }
536 return sources;
537}
538
539size_t Vehicle::movingCollisionCount() const {
540 return m_movingCollisions.size();

Callers

nothing calls this directly

Calls 5

callMethod · 0.80
getMethod · 0.45
transformMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected