diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 6b346dd5..2346a138 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -125,24 +125,24 @@ class UserController extends BaseAuthedController { } private function _addFreeItem(){ -// foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) { -// $heroMeta = mt\Item::get($heroId); -// if ($heroMeta) { -// Hero::addHero($heroMeta); -// User::upsertHeadList($heroMeta); -// } -// } -// $addItems =array(); -// foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) { -// list($itemId, $itemNum) = explode(':', $itemsStr); -// if ($itemNum > 0) { -// array_push($addItems, -// array( -// 'item_id' => $itemId, -// 'item_num' => $itemNum -// )); -// } -// } + foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) { + $heroMeta = mt\Item::get($heroId); + if ($heroMeta) { + Hero::addHero($heroMeta); + User::upsertHeadList($heroMeta); + } + } + $addItems =array(); + foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) { + list($itemId, $itemNum) = explode(':', $itemsStr); + if ($itemNum > 0) { + array_push($addItems, + array( + 'item_id' => $itemId, + 'item_num' => $itemNum + )); + } + } $items = array( array( 'item_id' => V_ITEM_GOLD,