修正获取队友问题
This commit is contained in:
parent
620f3bde52
commit
acf0fd0d57
@ -60,13 +60,19 @@ export class BattleHandler {
|
||||
};
|
||||
|
||||
public getFriend(aplayer: PlayerHandler): PlayerHandler{
|
||||
let obj;
|
||||
if(aplayer && aplayer._friend){
|
||||
return aplayer._friend;
|
||||
}
|
||||
// 防止出错冗余处理
|
||||
let res;
|
||||
for(let [key, obj] of this._players){
|
||||
if(obj._friend == aplayer){
|
||||
aplayer._friend = obj;
|
||||
res = obj;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
return res;
|
||||
};
|
||||
|
||||
public petIsValid(pet: PetHandler, players: PlayerHandler[], ct: GameUnitType): boolean{
|
||||
|
Loading…
x
Reference in New Issue
Block a user