|
@@ -318,31 +318,31 @@ class HeroProc {
|
|
|
|
|
|
$collectHeros = $user->heros->collectHeros;
|
|
|
my_Assert(StlUtil::dictHasProperty($collectHeros, $heroId) && StlUtil::dictHasProperty($collectHeros, $heroReplaceId), "找不到这个唤灵师");
|
|
|
-
|
|
|
+
|
|
|
$yanling = $collectHeros->$heroId->yanling;
|
|
|
$yanlingReplace = $collectHeros->$heroReplaceId->yanling;
|
|
|
-
|
|
|
+
|
|
|
//my_Assert($yanling->$yanlingRank->itemuid != 0 && $yanlingReplace->$yanlingReplaceRank->itemuid != 0, "找不到这个言灵");
|
|
|
$itemuid = $yanling->$yanlingRank->itemuid;
|
|
|
$replaceItemuid = $yanlingReplace->$yanlingReplaceRank->itemuid;
|
|
|
-
|
|
|
+
|
|
|
$yanling->$yanlingRank->itemuid = $replaceItemuid;
|
|
|
$yanlingReplace->$yanlingReplaceRank->itemuid = $itemuid;
|
|
|
|
|
|
- if($yanling->$yanlingRank->itemuid != 0){
|
|
|
+ if ($yanling->$yanlingRank->itemuid != 0) {
|
|
|
$newItemuid = $yanling->$yanlingRank->itemuid;
|
|
|
$user->store->yanling->$newItemuid->herouid = $heroId;
|
|
|
}
|
|
|
-
|
|
|
- if($yanlingReplace->$yanlingReplaceRank->itemuid != 0){
|
|
|
+
|
|
|
+ if ($yanlingReplace->$yanlingReplaceRank->itemuid != 0) {
|
|
|
$newReplaceItemuid = $yanlingReplace->$yanlingReplaceRank->itemuid;
|
|
|
$user->store->yanling->$newReplaceItemuid->herouid = $heroReplaceId;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$collectHeros->$heroId->yanling = $yanling;
|
|
|
$collectHeros->$heroReplaceId->yanling = $yanlingReplace;
|
|
|
$user->heros->collectHeros = $collectHeros;
|
|
|
-
|
|
|
+
|
|
|
req()->userInfo->game = $user;
|
|
|
|
|
|
UserProc::updateUserInfo(); # 回写玩家数据
|
|
@@ -592,7 +592,9 @@ class HeroProc {
|
|
|
// 取可用武器中第一个初始化 -- 策划要求初始英雄要带有武器 -- 王刚 2020年1月
|
|
|
$wp = null;
|
|
|
$arr = (array) GameConfig::item_weapon();
|
|
|
- ksort($arr); // todo: 排序不正常
|
|
|
+ uksort($arr, function ($a, $b) {
|
|
|
+ return intval($a) < intval($b);
|
|
|
+ }); // todo: 排序不正常
|
|
|
foreach ($arr as $id => $mo) {
|
|
|
// isEditor() and $mo = new \sm_item_weapon();
|
|
|
$heroList = explode(',', $mo->hero_id);
|