public function ai_can($command, $flush = false) { if ($flush || $this->npc_can === null) { $this->npc_can = Shadowcmd::getCurrentCommands($this, true, false, false, false, false, false); } return in_array($command, $this->npc_can, true); }
private function getCurrentCommands() { $back = array(); foreach ($this->members as $member) { $member instanceof SR_Player; if ($member->getLangISO() === 'bot') { $back[$member->getID()] = Shadowcmd::getCurrentCommands($member, false, false, false, false); } } return $back; }