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

Method entityCanDamage

source/game/scripting/StarWorldLuaBindings.cpp:1331–1339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1329 }
1330
1331 bool WorldEntityCallbacks::entityCanDamage(World* world, EntityId sourceId, EntityId targetId) {
1332 auto source = world->entity(sourceId);
1333 auto target = world->entity(targetId);
1334
1335 if (!source || !target || !source->getTeam().canDamage(target->getTeam(), false))
1336 return false;
1337
1338 return true;
1339 }
1340
1341 Json WorldEntityCallbacks::entityDamageTeam(World* world, EntityId entityId) {
1342 if (auto entity = world->entity(entityId))

Callers

nothing calls this directly

Calls 3

canDamageMethod · 0.80
entityMethod · 0.45
getTeamMethod · 0.45

Tested by

no test coverage detected