public void onActorDead(ref DefaultGameEventParam prm) { if ((prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp)) { int index = -1; while (++index < this.heroHeads.Length) { PlayerHead head = this.heroHeads[index]; if ((head.MyHero != 0) && (head.MyHero == prm.src)) { head.OnMyHeroDead(); break; } } if (((index < this.heroHeads.Length) && !Singleton <BattleLogic> .instance.GetCurLvelContext().isPVPMode) && ActorHelper.IsCaptainActor(ref prm.src)) { int num2 = -1; while (++num2 < this.heroHeads.Length) { if ((num2 != index) && ((this.heroHeads[num2].MyHero != 0) && !this.heroHeads[num2].MyHero.handle.ActorControl.IsDeadState)) { this.pickHeroHead(this.heroHeads[num2]); break; } } } } }
public void onActorDead(ref GameDeadEventParam prm) { if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp) { int num = -1; while (++num < this.heroHeads.Length) { PlayerHead playerHead = this.heroHeads[num]; if (playerHead.MyHero && playerHead.MyHero == prm.src) { playerHead.OnMyHeroDead(); break; } } if (num < this.heroHeads.Length && !Singleton <BattleLogic> .instance.GetCurLvelContext().IsMobaMode() && ActorHelper.IsCaptainActor(ref prm.src)) { int num2 = -1; while (++num2 < this.heroHeads.Length) { if (num2 != num && this.heroHeads[num2].MyHero && !this.heroHeads[num2].MyHero.handle.ActorControl.IsDeadState) { this.pickHeroHead(this.heroHeads[num2]); break; } } } } }