fix: dedup isCollidingWith
This commit is contained in:
parent
d77eff36e3
commit
50f1606a2b
|
@ -39,8 +39,8 @@ export class Damaging extends Trait {
|
||||||
tick(elapsed) {
|
tick(elapsed) {
|
||||||
if (AVOCADO_SERVER) {
|
if (AVOCADO_SERVER) {
|
||||||
const isCollidingWith = this.entity.isCollidingWith;
|
const isCollidingWith = this.entity.isCollidingWith;
|
||||||
for (let i = 0; i < isCollidingWith.length; ++i) {
|
for (const uuid in isCollidingWith) {
|
||||||
const entity = isCollidingWith[i];
|
const entity = isCollidingWith[uuid];
|
||||||
if (entity.is('vulnerable') && !entity.isInvulnerable) {
|
if (entity.is('vulnerable') && !entity.isInvulnerable) {
|
||||||
entity.takeDamageFrom(this.entity);
|
entity.takeDamageFrom(this.entity);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user