Commit 221fdc75 authored by ranxiaoping's avatar ranxiaoping
Browse files

改为队伍第一个伙伴

parent c5e0ca02
Showing with 4 additions and 8 deletions
+4 -8
......@@ -132,7 +132,7 @@ export const getAllTeamState = async()=>{
let _info = dbInfo.teamMap.get(no);
if(_info){ msg.state = _info.state;}
//显示队伍中战斗力最高伙伴名字、头像。
const partnerId:number = await getMaxPowerPartnerId(team);
const partnerId:number = await getFirstPartnerId(team);
let cfg = getPartnerInfo({id: partnerId});
msg.name = cfg.name;
msg.icon = cfg.icon;
......@@ -198,14 +198,10 @@ const getTeamPartnerIdList = (team:any[])=>{
return heroIdArr;
}
//获取队伍中战力最高的伙伴配置id
const getMaxPowerPartnerId = async(team:any[])=>{
let partnerList:number[] = getTeamPartnerIdList(team);
//显示队伍中战斗力最高伙伴名字、头像。
let herosPowerList = await clientRpc(getHerosPower._$topic, partnerList);
const heroId = partnerList[herosPowerList.indexOf(Math.max(...herosPowerList))];
//获取队伍中第一个伙伴配置id
const getFirstPartnerId = async(team:any[])=>{
for (let value of team) {
if (value.heroId === heroId) {
if (value.heroId > 0) {
return value.heroTid
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment