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

Method queryHit

source/game/StarPlayer.cpp:510–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510Maybe<HitType> Player::queryHit(DamageSource const& source) const {
511 if (!inWorld() || isDead() || m_isAdmin || isTeleporting() || m_statusController->statPositive("invulnerable"))
512 return {};
513
514 if (m_tools->queryShieldHit(source))
515 return HitType::ShieldHit;
516
517 if (source.intersectsWithPoly(world()->geometry(), m_movementController->collisionBody()))
518 return HitType::Hit;
519
520 return {};
521}
522
523Maybe<PolyF> Player::hitPoly() const {
524 return m_movementController->collisionBody();

Callers

nothing calls this directly

Calls 5

queryShieldHitMethod · 0.80
intersectsWithPolyMethod · 0.80
statPositiveMethod · 0.45
geometryMethod · 0.45
collisionBodyMethod · 0.45

Tested by

no test coverage detected