Fix Komeiji knight summon sight
This commit is contained in:
parent
36b229a053
commit
e2dfb8fe2b
@ -40,7 +40,7 @@ namespace Logic.Skill
|
||||
if (!info.DamageOriginGrid.RealUnit(mapData,out var _) && mapData.CheckLandTypeForGrid(fullType, info.DamageOriginGrid))
|
||||
{
|
||||
if (mapData.AddUnitData(info.DamageOriginGrid.Id, capitalCity.Id, fullType, out var newUnit))
|
||||
newUnit.SetFullActionPoint();
|
||||
OnKomeijiRiderCreated(mapData, player, newUnit);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -56,10 +56,21 @@ namespace Logic.Skill
|
||||
}
|
||||
ReturnAroundBuf();
|
||||
if (randomList.Count == 0) return;
|
||||
var index = mapData.Net.GetRandom(mapData).Next(0, randomList.Count - 1);
|
||||
var index = mapData.Net.GetRandom(mapData).Next(0, randomList.Count);
|
||||
if (mapData.AddUnitData(randomList[index].Id, capitalCity.Id, fullType, out var newUnit))
|
||||
newUnit.SetFullActionPoint();
|
||||
OnKomeijiRiderCreated(mapData, player, newUnit);
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnKomeijiRiderCreated(MapData mapData, PlayerData player, UnitData newUnit)
|
||||
{
|
||||
newUnit.SetFullActionPoint();
|
||||
|
||||
var grid = newUnit.Grid(mapData);
|
||||
if (grid == null) return;
|
||||
|
||||
Main.PlayerLogic.UpdateSightByRadius_LogicView(mapData, player, grid, newUnit.GetSightRange(mapData, grid));
|
||||
newUnit.Renderer(mapData)?.InstantUpdateUnit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user