|
@@ -56,10 +56,20 @@ class UserGameHeroModel extends Object_ext {
|
|
|
$this->recordMaxUID = 0;
|
|
|
$this->collectHeros = ObjectInit(); # 初始化英雄集合
|
|
|
$hids = GameConfig::primordial_data()->User_Heros; # 设置初始英雄
|
|
|
- foreach ($hids as $heroModelId) {
|
|
|
+ my_Assert(null != $hids, ErrCode::err_const_no);
|
|
|
+ foreach ($hids as $heroModelId_yanlingid) {
|
|
|
+ list( $heroModelId, $yanlingId) = explode('_', $heroModelId_yanlingid);
|
|
|
$uid = HeroProc::CreateNewGameHeroUID($this->collectHeros, $this->recordMaxUID);
|
|
|
$this->recordMaxUID = $uid;
|
|
|
$hero = HeroProc::getGameHeroModelInstance($heroModelId, $uid);
|
|
|
+ // 初始化言灵
|
|
|
+ $yanlingMo = GameConfig::item_yanling_getItem($yanlingId);
|
|
|
+ my_Assert(null != $yanlingMo, ErrCode::err_const_no);
|
|
|
+ $yl_uid = StoreProc::PutYanLingInStore($yanlingMo->typeId, req());
|
|
|
+ req()->userInfo->game->store->yanling->$yl_uid->herouid = $uid;
|
|
|
+ $position = $yanlingMo->position;
|
|
|
+ $hero->yanling->$position = array("itemuid" => $yl_uid); # 装备位置
|
|
|
+
|
|
|
$this->collectHeros->$uid = $hero;
|
|
|
$this->displayHeroUID = $uid;
|
|
|
$this->firendSupportHeroUID = $uid;
|