Vault Re-Alignment
This commit is contained in:
@@ -27,15 +27,28 @@ namespace ProjectM.Simulation
|
||||
[BurstCompile]
|
||||
public void OnUpdate(ref SystemState state)
|
||||
{
|
||||
foreach (var (health, control, deadEnabled) in
|
||||
foreach (var (health, control, deadEnabled, entity) in
|
||||
SystemAPI.Query<RefRO<Health>, RefRW<CharacterControl>, EnabledRefRW<Dead>>()
|
||||
.WithAll<PlayerTag, Simulate>()
|
||||
.WithPresent<Dead>())
|
||||
.WithPresent<Dead>()
|
||||
.WithEntityAccess())
|
||||
{
|
||||
bool isDead = health.ValueRO.Current <= 0f;
|
||||
deadEnabled.ValueRW = isDead;
|
||||
if (isDead)
|
||||
{
|
||||
control.ValueRW.MoveVelocity = float3.zero;
|
||||
// MC-1: clear any in-flight dash window + restore base sharpness so a death mid-dash leaves
|
||||
// no stale i-frames / stuck-fast on respawn (DashSystem skips dead players via .WithDisabled<Dead>()).
|
||||
if (SystemAPI.HasComponent<DashState>(entity))
|
||||
SystemAPI.SetComponent(entity, default(DashState));
|
||||
if (SystemAPI.HasComponent<CharacterComponent>(entity))
|
||||
{
|
||||
var cc = SystemAPI.GetComponent<CharacterComponent>(entity);
|
||||
cc.GroundedMovementSharpness = 15f;
|
||||
SystemAPI.SetComponent(entity, cc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user