perf: isCollidingWith to array

This commit is contained in:
cha0s 2019-05-01 17:34:30 -05:00
parent c49c34e46c
commit 07a0cfea63

View File

@ -39,8 +39,8 @@ export class Damaging extends Trait {
tick(elapsed) {
if (AVOCADO_SERVER) {
const isCollidingWith = this.entity.isCollidingWith;
for (const uuid in isCollidingWith) {
const entity = isCollidingWith[uuid];
for (let i = 0; i < isCollidingWith.length; i++) {
const entity = isCollidingWith[i];
if (entity.is('vulnerable') && !entity.isInvulnerable) {
entity.takeDamageFrom(this.entity);
}