fixed bb detection when monster is attacking

This commit is contained in:
GameHerobrine 2024-11-08 00:33:40 +03:00
parent b18cf8de69
commit 6e6dc3eb4c

View file

@ -15,7 +15,7 @@ class Monster extends Creature{
* @see Entity::attackEntity()
*/
public function attackEntity($entity, $distance){
if($distance < 2.0 && $entity->boundingBox->maxX > $this->boundingBox->minY && $entity->boundingBox->minY < $this->boundingBox->maxY){
if($distance < 2.0 && $entity->boundingBox->maxY > $this->boundingBox->minY && $entity->boundingBox->minY < $this->boundingBox->maxY){
$entity->harm($this->getAttackDamage(), $this->eid);
return true;
}else{