mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-03 04:36:03 +08:00
Remove some unnecessary variables
This commit is contained in:
@@ -15,7 +15,7 @@ namespace EggLink.DanhengServer.Game.Battle
|
||||
{
|
||||
public class BattleManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
{
|
||||
public void StartBattle(SceneCastSkillCsReq req, MazeSkill skill, List<uint> hitTargetEntityIdList)
|
||||
public void StartBattle(SceneCastSkillCsReq req, MazeSkill skill)
|
||||
{
|
||||
if (Player.BattleInstance != null) return;
|
||||
var targetList = new List<EntityMonster>();
|
||||
@@ -25,7 +25,7 @@ namespace EggLink.DanhengServer.Game.Battle
|
||||
|
||||
if (Player.SceneInstance!.AvatarInfo.ContainsKey((int)req.AttackedByEntityId))
|
||||
{
|
||||
foreach (var entity in hitTargetEntityIdList)
|
||||
foreach (var entity in req.HitTargetEntityIdList)
|
||||
{
|
||||
Player.SceneInstance!.Entities.TryGetValue((int)entity, out var entityInstance);
|
||||
if (entityInstance is EntityMonster monster)
|
||||
@@ -52,7 +52,7 @@ namespace EggLink.DanhengServer.Game.Battle
|
||||
} else
|
||||
{
|
||||
bool isAmbushed = false;
|
||||
foreach (var entity in hitTargetEntityIdList)
|
||||
foreach (var entity in req.HitTargetEntityIdList)
|
||||
{
|
||||
if (Player.SceneInstance!.AvatarInfo.ContainsKey((int)entity))
|
||||
{
|
||||
|
||||
@@ -43,23 +43,8 @@ namespace EggLink.DanhengServer.Server.Packet.Recv.Battle
|
||||
|
||||
if (req.AssistMonsterEntityIdList.Count > 0)
|
||||
{
|
||||
List<uint> hitTargetEntityIdList = new List<uint>();
|
||||
if (req.HitTargetEntityIdList.Count > 0)
|
||||
{
|
||||
foreach (uint id in req.HitTargetEntityIdList)
|
||||
{
|
||||
hitTargetEntityIdList.Add(id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (uint id in req.AssistMonsterEntityIdList)
|
||||
{
|
||||
hitTargetEntityIdList.Add(id);
|
||||
}
|
||||
}
|
||||
// Start battle
|
||||
connection.Player!.BattleManager!.StartBattle(req, mazeSkill!, [.. hitTargetEntityIdList]);
|
||||
connection.Player!.BattleManager!.StartBattle(req, mazeSkill!);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user