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

Method pushRemoteDamageRequest

source/game/StarDamageManager.cpp:140–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void DamageManager::pushRemoteDamageRequest(RemoteDamageRequest const& remoteDamageRequest) {
141 if (remoteDamageRequest.destinationConnection() != m_connectionId)
142 throw StarException("RemoteDamageRequest routed to wrong DamageManager");
143
144 if (auto targetEntity = m_world->entity(remoteDamageRequest.targetEntityId)) {
145 starAssert(targetEntity->isMaster());
146 for (auto& damageNotification : targetEntity->applyDamage(remoteDamageRequest.damageRequest))
147 addDamageNotification({remoteDamageRequest.damageRequest.sourceEntityId, std::move(damageNotification)});
148 }
149}
150
151void DamageManager::pushRemoteDamageNotification(RemoteDamageNotification remoteDamageNotification) {
152 if (auto sourceEntity = m_world->entity(remoteDamageNotification.sourceEntityId)) {

Callers 2

handleIncomingPacketsMethod · 0.80
handleIncomingPacketsMethod · 0.80

Calls 5

StarExceptionClass · 0.85
destinationConnectionMethod · 0.80
isMasterMethod · 0.80
entityMethod · 0.45
applyDamageMethod · 0.45

Tested by

no test coverage detected