From 049c561c50982beecbb6b3e71248f2c6d7c0fbf5 Mon Sep 17 00:00:00 2001 From: oliver Date: Fri, 22 May 2015 14:24:08 +0200 Subject: [PATCH] check Achievements when managing Charactergroups Quests --- controllers/CharactergroupsquestsController.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/controllers/CharactergroupsquestsController.inc b/controllers/CharactergroupsquestsController.inc index 593ec67b..886b220f 100644 --- a/controllers/CharactergroupsquestsController.inc +++ b/controllers/CharactergroupsquestsController.inc @@ -198,6 +198,7 @@ $xps = $this->request->getPostParam('xps'); foreach($groups as &$group) { + // Set XPs if(array_key_exists($group['url'], $xps) && $xps[$group['url']] != 'null') { $xpsFactor = intval($xps[$group['url']]) / $quest['xps']; @@ -206,6 +207,20 @@ else { $this->Charactergroupsquests->deleteGroupForQuest($quest['id'], $group['id']); } + + // Check Achievements of Characters + $characters = $this->Characters->getCharactersForGroup($group['id']); + foreach($characters as &$character) + { + if($character['id'] != $this->Auth->getUserId()) + { + $this->Achievement->checkAchievements( + $seminary['id'], + $character['id'], + array('character', 'achievement') + ); + } + } } }