Files

30 lines
772 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.
# MercanRey2.js — collectContacts() (satır 428)
[← MercanRey2.js](index.md) · [← Master](../../wiki.md)
```javascript
function collectContacts(target, observer)
{
var contacts = {};
var pos = target.getPosition();
var entities = target.getWorld().getEntities(pos.x - 28, pos.y - 14, pos.z - 28, pos.x + 28, pos.y + 14, pos.z + 28);
for (var i = 0; i < entities.size(); i++)
{
var entity = entities.get(i);
if (entity == null || entity.isSame(target) || entity.isSame(observer) || !entity.isLivingBase())
{
continue;
}
if (entity.isPlayer() || entity.isNPC())
{
addContact(contacts, entity);
}
}
return contacts;
}
```