correcty check permissions for a Quest if one of the previous Quests has as following Quest the Quest itself (Issue #229)
This commit is contained in:
parent
2c52f6db9c
commit
ee6f25dbdb
1 changed files with 9 additions and 4 deletions
|
|
@ -165,12 +165,13 @@
|
|||
{
|
||||
// Previous Quests
|
||||
// One previous Quest has to be solved and no other
|
||||
// following Quests of ones has to be tried
|
||||
// following Quest of ones has to be tried
|
||||
// except it is also an previous Quest of the current Quest
|
||||
$solved = false;
|
||||
$tried = false;
|
||||
foreach($previousQuests as &$previousQuest)
|
||||
{
|
||||
// // Check previous Quest
|
||||
// Check previous Quest
|
||||
if($this->Quests->hasCharacterSolvedQuest($previousQuest['id'], $character['id']))
|
||||
{
|
||||
$solved = true;
|
||||
|
|
@ -182,8 +183,12 @@
|
|||
// Check following Quest
|
||||
if($followingQuest['id'] != $quest['id'] && $this->Quests->hasCharacterTriedQuest($followingQuest['id'], $character['id']))
|
||||
{
|
||||
$tried = true;
|
||||
break;
|
||||
$followingFollowingQuests = $this->Quests->getNextQuests($followingQuest['id']);
|
||||
if(!in_array($quest['id'], array_map(function($q) { return $q['id']; }, $followingFollowingQuests)))
|
||||
{
|
||||
$tried = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue