movement tweaks

This commit is contained in:
GameHerobrine 2023-02-22 16:08:40 +03:00
parent efca0f8398
commit 90d1865cb1
4 changed files with 18 additions and 9 deletions

View file

@ -22,6 +22,7 @@ abstract class Animal extends Creature implements Ageable, Breedable{
public function harm($dmg, $cause = "generic", $force = false){
$ret = parent::harm($dmg, $cause, $force);
$this->inPanic |= ($ret && is_numeric($cause));
$this->inLove = false;
return $ret;
}
@ -32,7 +33,7 @@ abstract class Animal extends Creature implements Ageable, Breedable{
public function breed(){
$c = $this->spawnChild();
if($this->server->dhandle("entity.animal.breed", ["parent" => $this, "child" => $c]) !== false){
$c->parent = &$this;
$c->parent = $this;
$this->server->api->entity->spawnToAll($c);
}
}