mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
new ai task, fixes of old ones, php8 fixes
This commit is contained in:
parent
a907a7cf5e
commit
80bdddb817
13 changed files with 1581 additions and 1458 deletions
|
|
@ -38,9 +38,13 @@ class EntityAI
|
|||
* @return TaskBase | false
|
||||
*/
|
||||
public function getTask($id){
|
||||
return $this->tasks[$id] ?: false; //i never saw this operator before
|
||||
return isset($this->tasks[$id]) ? $this->tasks[$id] : false;
|
||||
}
|
||||
|
||||
public function isStarted($id){
|
||||
$task = @$this->getTask($id);
|
||||
return $task instanceof TaskBase && $task->isStarted;
|
||||
}
|
||||
|
||||
public function updateTasks(){
|
||||
foreach($this->tasks as $t){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue