Skip to content

Commit 282dc11

Browse files
Update Live.ts
1 parent 3552b10 commit 282dc11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Entity/Live.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ export default class LivingEntity extends ObjectEntity {
111111
this.healthData.health = 0;
112112

113113
let killer: ObjectEntity = source;
114-
while (killer.relationsData.values.owner instanceof ObjectEntity && killer.relationsData.values.owner.hash !== 0) {
114+
while (ObjectEntity.isObject(killer.relationsData.values.owner) && killer.relationsData.values.owner.hash !== 0) {
115115
killer = killer.relationsData.values.owner;
116116
}
117117

118-
if (killer instanceof LivingEntity) {
118+
if (LivingEntity.isLive(killer)) {
119119
this.onDeath(killer);
120120
}
121121

@@ -136,7 +136,7 @@ export default class LivingEntity extends ObjectEntity {
136136
if (this.healthData.values.health <= 0) {
137137
this.destroy(true);
138138

139-
this.damagedEntities = [];
139+
this.damagedEntities.length = 0;
140140
return;
141141
}
142142

@@ -154,7 +154,7 @@ export default class LivingEntity extends ObjectEntity {
154154
this.healthData.health = this.healthData.values.maxHealth;
155155
}
156156

157-
this.damagedEntities = [];
157+
this.damagedEntities.length = 0;
158158
}
159159

160160
public tick(tick: number) {

0 commit comments

Comments
 (0)