Persist turret controller state in typed snapshots

This commit is contained in:
Meta Vens 2026-06-14 16:40:08 +01:00
commit 6deea479dd
11 changed files with 91 additions and 8 deletions

View file

@ -1119,7 +1119,10 @@ namespace GameCult.Aetheria.State.Unity
bool triggerPulled,
bool statModifierApplied,
bool statModifierExecuted,
int statModifierTargetStatCount)
int statModifierTargetStatCount,
int turretControllerWeaponCount,
double turretControllerShotSpeed,
bool turretControllerPredictShots)
{
OwnerKind = ownerKind;
OwnerIndex = ownerIndex;
@ -1173,6 +1176,9 @@ namespace GameCult.Aetheria.State.Unity
StatModifierApplied = statModifierApplied;
StatModifierExecuted = statModifierExecuted;
StatModifierTargetStatCount = statModifierTargetStatCount;
TurretControllerWeaponCount = turretControllerWeaponCount;
TurretControllerShotSpeed = turretControllerShotSpeed;
TurretControllerPredictShots = turretControllerPredictShots;
}
public string OwnerKind { get; }
@ -1227,5 +1233,8 @@ namespace GameCult.Aetheria.State.Unity
public bool StatModifierApplied { get; }
public bool StatModifierExecuted { get; }
public int StatModifierTargetStatCount { get; }
public int TurretControllerWeaponCount { get; }
public double TurretControllerShotSpeed { get; }
public bool TurretControllerPredictShots { get; }
}
}

View file

@ -909,7 +909,10 @@ namespace GameCult.Aetheria.State.Unity
var statModifierApplied = ReadFieldBool(ref reader, behaviorFields, 49);
var statModifierExecuted = ReadFieldBool(ref reader, behaviorFields, 50);
var statModifierTargetStatCount = ReadFieldInt32(ref reader, behaviorFields, 51);
SkipRemaining(ref reader, behaviorFields, 52);
var turretControllerWeaponCount = ReadFieldInt32(ref reader, behaviorFields, 52);
var turretControllerShotSpeed = ReadFieldDouble(ref reader, behaviorFields, 53);
var turretControllerPredictShots = ReadFieldBool(ref reader, behaviorFields, 54);
SkipRemaining(ref reader, behaviorFields, 55);
behaviorStates[behavior] = new AetheriaRuntimeBehaviorStateSnapshot(
ownerKind,
ownerIndex,
@ -962,7 +965,10 @@ namespace GameCult.Aetheria.State.Unity
triggerPulled,
statModifierApplied,
statModifierExecuted,
statModifierTargetStatCount);
statModifierTargetStatCount,
turretControllerWeaponCount,
turretControllerShotSpeed,
turretControllerPredictShots);
}
return behaviorStates;

View file

@ -851,5 +851,14 @@ namespace GameCult.Aetheria.State.Unity
[Key(51)]
public int StatModifierTargetStatCount { get; set; }
[Key(52)]
public int TurretControllerWeaponCount { get; set; }
[Key(53)]
public double TurretControllerShotSpeed { get; set; }
[Key(54)]
public bool TurretControllerPredictShots { get; set; }
}
}