Files

31 lines
889 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Darklord.js — collectDomainParticipants() (satır 2208)
[← Darklord.js](index.md) · [← Master](../../wiki.md)
```javascript
function collectDomainParticipants(c, owner, cx, floorY, cz)
{
var out = {};
out[lower(owner.getName())] = true;
var players = allPlayers(c);
var radiusSq = (DOMAIN_RADIUS - 1.0) * (DOMAIN_RADIUS - 1.0);
for (var i = 0; i < listSize(players); i++)
{
var pl = listGet(players, i);
if (!pl || !pl.getName) continue;
if (getDimensionSafe(pl) !== getDimensionSafe(owner)) continue;
var pos = pl.getPosition();
var dx = pos.x - cx;
var dz = pos.z - cz;
if (dx * dx + dz * dz <= radiusSq && pos.y >= floorY - 2 && pos.y <= floorY + DOMAIN_HEIGHT + 4)
{
out[lower(pl.getName())] = true;
}
}
return out;
}
```