Fix dash charge refresh before turn start render
This commit is contained in:
parent
c7395f6f57
commit
c3ff43e14f
@ -112,7 +112,8 @@ namespace RuntimeData
|
||||
{
|
||||
Main.UnitLogic.StartNextTurn(map, unit);
|
||||
unit.OnTurnStart(map);
|
||||
ClearItemActionPointIfNeeded(map, unit);
|
||||
ClearItemActionPointIfNeeded(map, unit, false);
|
||||
RefreshTurnStartRenderer(map, unit);
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,10 +129,18 @@ namespace RuntimeData
|
||||
}
|
||||
}
|
||||
|
||||
private static void ClearItemActionPointIfNeeded(MapData map, UnitData unit)
|
||||
private static void ClearItemActionPointIfNeeded(MapData map, UnitData unit, bool refreshRenderer = true)
|
||||
{
|
||||
if (unit == null || !unit.HasEffectiveSkill(SkillType.Item, out _)) return;
|
||||
unit.ActionPoint.Clear();
|
||||
if (refreshRenderer)
|
||||
unit.Renderer(map)?.InstantUpdateUnit(true);
|
||||
}
|
||||
|
||||
private static void RefreshTurnStartRenderer(MapData map, UnitData unit)
|
||||
{
|
||||
if (unit == null || !unit.IsAlive()) return;
|
||||
// Skill OnTurnStart may refresh visible charge/status levels such as Dash.
|
||||
unit.Renderer(map)?.InstantUpdateUnit(true);
|
||||
}
|
||||
|
||||
|
||||
@ -2233,12 +2233,10 @@ namespace Logic
|
||||
if (unitData.HasEffectiveSkill(SkillType.Item, out _))
|
||||
{
|
||||
unitData.ActionPoint.Clear();
|
||||
unitData.Renderer(mapData)?.InstantUpdateUnit(true);
|
||||
return;
|
||||
}
|
||||
|
||||
unitData.SetFullActionPoint();
|
||||
unitData.Renderer(mapData)?.InstantUpdateUnit(true);
|
||||
unitData.SetFullActionPoint_AllSkillRefresh();
|
||||
}
|
||||
|
||||
public void UnitEndTurn(MapData mapData, UnitData unitData)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user