use cumulated data also for total Seminary XPs
This commit is contained in:
parent
5ca9fde6b0
commit
4bc2920d02
2 changed files with 8 additions and 6 deletions
|
|
@ -372,7 +372,7 @@
|
|||
* @param array $calculatedQuests IDs of already calculated Quests
|
||||
* @return array Cumulated data for Questgroup
|
||||
*/
|
||||
public function getCumulatedDataForQuestgroup($questgroupId, $characterId, &$calculatedQuests=array())
|
||||
public function getCumulatedDataForQuestgroup($questgroupId, $characterId=null, &$calculatedQuests=array())
|
||||
{
|
||||
// Cumulated data
|
||||
$data = array(
|
||||
|
|
@ -424,12 +424,12 @@
|
|||
* @param array $calculatedQuests IDs of already calculated Quests
|
||||
* @return array Cumulated data for Quest
|
||||
*/
|
||||
public function getCumulatedDataForQuest($quest, $characterId, &$calculatedQuests=array())
|
||||
public function getCumulatedDataForQuest($quest, $characterId=null, &$calculatedQuests=array())
|
||||
{
|
||||
// Cumulated data
|
||||
$data = array(
|
||||
'xps' => $quest['xps'],
|
||||
'character_xps' => ($this->Quests->hasCharacterSolvedQuest($quest['id'], $characterId)) ? $quest['xps'] : 0
|
||||
'character_xps' => (!is_null($characterId) && $this->Quests->hasCharacterSolvedQuest($quest['id'], $characterId)) ? $quest['xps'] : 0
|
||||
);
|
||||
|
||||
// Related Questgroups
|
||||
|
|
@ -466,7 +466,7 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Summarize XPs of all Quests for a Questgroup and its
|
||||
* sub-Questgroups solved by a Character.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -122,8 +122,10 @@
|
|||
{
|
||||
// Get Questgroups
|
||||
$questgroups = $this->Questgroups->getQuestgroupsForHierarchy($hierarchy['id']);
|
||||
foreach($questgroups as &$questgroup) {
|
||||
$xps += $this->Questgroups->getAchievableXPsForQuestgroup($questgroup['id']);
|
||||
foreach($questgroups as &$questgroup)
|
||||
{
|
||||
$data = $this->Questgroups->getCumulatedDataForQuestgroup($questgroup['id']);
|
||||
$xps += $data['xps'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue