mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
fixed target invalidation
This commit is contained in:
parent
7ad98fe444
commit
75844b5a62
3 changed files with 4 additions and 3 deletions
|
|
@ -50,8 +50,8 @@ class TaskAttackPlayer extends TaskBase
|
|||
|
||||
|
||||
public function isTargetValid(EntityAI $ai){
|
||||
$e = $ai->entity; //TODO sometimes it keeps being valid even after getting invalid (/gm 1 -> /gm 0 switch)
|
||||
if($e->target instanceof Entity){
|
||||
$e = $ai->entity;
|
||||
if($e->target instanceof Entity && !$e->target->closed){
|
||||
$t = $e->target;
|
||||
$xDiff = ($t->x - $e->x);
|
||||
$yDiff = ($t->y - $e->y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue