【报错日志】增加cellindex为-1时提前返回,不进行错误日志打印

main
刘涛 2024-10-22 12:22:00 +08:00
parent 4a6071903f
commit 01e9dc3a74
1 changed files with 24 additions and 0 deletions

View File

@ -89,6 +89,10 @@ namespace Gameplay.Area
private bool _CheckCenterIsSelfVehicle(int centerCellIndex)
{
if (centerCellIndex == -1)
{
return false;
}
var units = AreaManager.instance.GetUnitsByCellIndex(centerCellIndex);
var senderTroopId = troopId;
var isSelf = false;
@ -107,6 +111,10 @@ namespace Gameplay.Area
private bool _CheckAreaContainsSelfSide(int centerCellIndex)
{
if (centerCellIndex == -1)
{
return false;
}
var influenceAreaId = influenceId;
var areaIndexs = AreaManager.instance.GetCellIndexs(centerCellIndex, influenceAreaId);
// 查找所有友军
@ -121,6 +129,10 @@ namespace Gameplay.Area
private bool _CheckAreaContainsEnemy(int centerCellIndex)
{
if (centerCellIndex == -1)
{
return false;
}
if (troopId == ETroopsId.Self)
{
// 需要额外判断是否在光亮区域
@ -141,6 +153,10 @@ namespace Gameplay.Area
private bool _CheckCenterIsEmpty(int centerCellIndex)
{
if (centerCellIndex == -1)
{
return false;
}
if (troopId == ETroopsId.Self)
{
// 需要额外判断是否在光亮区域
@ -166,6 +182,10 @@ namespace Gameplay.Area
private bool _CheckCenterIsSelfSide(int centerCellIndex)
{
if (centerCellIndex == -1)
{
return false;
}
var units = AreaManager.instance.GetUnitsByCellIndex(centerCellIndex);
var senderTroopId = troopId;
var isSelf = false;
@ -187,6 +207,10 @@ namespace Gameplay.Area
private bool _CheckCenterIsEnemy(int centerCellIndex)
{
if (centerCellIndex == -1)
{
return false;
}
if (troopId == ETroopsId.Self)
{
// 需要额外判断是否在光亮区域