Only bite non-monsters
This commit is contained in:
parent
493e993e45
commit
e583377d45
|
@ -321,7 +321,7 @@ export class AnimalEntity extends Entity {
|
||||||
box[1][1] += 20
|
box[1][1] += 20
|
||||||
}
|
}
|
||||||
|
|
||||||
let entities: AnimalEntity[] = ctx.queryEntities([box[0][0], box[1][0]], [box[0][1], box[1][1]]).filter(v=>v instanceof AnimalEntity && v !== this) as AnimalEntity[]
|
let entities: AnimalEntity[] = ctx.queryEntities([box[0][0], box[1][0]], [box[0][1], box[1][1]]).filter(v=>v instanceof AnimalEntity && v !== this && !v.isMonster) as AnimalEntity[]
|
||||||
if (entities.length > 0) {
|
if (entities.length > 0) {
|
||||||
entities[0].dead = true
|
entities[0].dead = true
|
||||||
entities[0].shouldGib = true
|
entities[0].shouldGib = true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user