Only bite non-monsters

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-30 12:03:59 -08:00
parent 493e993e45
commit e583377d45

View File

@ -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