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

Method needsDamageNotification

source/game/StarWorldServer.cpp:2520–2531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2518}
2519
2520bool WorldServer::ClientInfo::needsDamageNotification(RemoteDamageNotification const& rdn) const {
2521 if (clientId == connectionForEntity(rdn.sourceEntityId) || clientId == connectionForEntity(rdn.damageNotification.targetEntityId))
2522 return true;
2523
2524 if (clientSlavesNetVersion.contains(rdn.damageNotification.targetEntityId))
2525 return true;
2526
2527 if (clientState.window().contains(Vec2I::floor(rdn.damageNotification.position)))
2528 return true;
2529
2530 return false;
2531}
2532
2533InteractiveEntityPtr WorldServer::getInteractiveInRange(Vec2F const& targetPosition, Vec2F const& sourcePosition, float maxRange) const {
2534 return WorldImpl::getInteractiveInRange(m_geometry, m_entityMap, targetPosition, sourcePosition, maxRange);

Callers 2

handleIncomingPacketsMethod · 0.80
updateDamageMethod · 0.80

Calls 3

connectionForEntityFunction · 0.85
containsMethod · 0.45
windowMethod · 0.45

Tested by

no test coverage detected