correctly check permissions for parallel Quests (fixes #97)

This commit is contained in:
oliver 2015-05-12 11:58:56 +02:00
commit 747f167781

View file

@ -193,7 +193,7 @@
{ {
// Previous Quests // Previous Quests
// One previous Quest has to be solved and no other // One previous Quest has to be solved and no other
// following Quest of ones has to be tried // following Quest of ones has to be entered
// except it is also an previous Quest of the current Quest // except it is also an previous Quest of the current Quest
$solved = false; $solved = false;
$tried = false; $tried = false;
@ -209,7 +209,7 @@
foreach($followingQuests as $followingQuest) foreach($followingQuests as $followingQuest)
{ {
// Check following Quest // Check following Quest
if($followingQuest['id'] != $quest['id'] && $this->Quests->hasCharacterTriedQuest($followingQuest['id'], $character['id'])) if($followingQuest['id'] != $quest['id'] && $this->Quests->hasCharacterEnteredQuest($followingQuest['id'], $character['id']))
{ {
$followingFollowingQuests = $this->Quests->getNextQuests($followingQuest['id']); $followingFollowingQuests = $this->Quests->getNextQuests($followingQuest['id']);
if(!in_array($quest['id'], array_map(function($q) { return $q['id']; }, $followingFollowingQuests))) if(!in_array($quest['id'], array_map(function($q) { return $q['id']; }, $followingFollowingQuests)))