Remove some unnecessary variables

This commit is contained in:
WatchAndyTW
2024-07-06 14:07:00 +08:00
parent 08c427f5d2
commit ce0fb357bc
2 changed files with 4 additions and 19 deletions

View File

@@ -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))
{

View File

@@ -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
{