Read the pending burst, not Progress, as the mark that Trigger ran; sound the charged control by its own event

The cooldown now starts at a burst's first fired round, so Progress no longer moves at the trigger.
IffAndCombatTests read CanFire (false while a burst is pending) instead, and the charged-weapon
control uses the charge-start event name the sound bank resolves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-29 21:23:04 +02:00
commit 0e73bbac72
2 changed files with 4 additions and 4 deletions

View file

@ -652,7 +652,7 @@ public sealed class FireControlPerWeaponTests : IDisposable
r.Shooter.Target.Value = null;
Aim(r, float2(0, 1));
var weapon = (ChargedWeapon) r.Gun.Weapon;
r.Gun.Item.SoundBank = new WwiseMetaSoundBank { IncludedEvents = new[] { new WwiseMetaObject { Id = 7, Name = "gun_fire" } } };
r.Gun.Item.SoundBank = new WwiseMetaSoundBank { IncludedEvents = new[] { new WwiseMetaObject { Id = 7, Name = "gun_charge_play" } } };
var starts = 0;
var sounds = 0;
weapon.OnStartCharging += () => starts++;

View file

@ -250,7 +250,7 @@ public sealed class IffAndCombatTests : IDisposable
weapon.Activate();
Assert.Equal(0f, weapon.Progress); // Trigger() was safed: no cooldown/burst was started
Assert.True(weapon.CanFire); // Trigger() was safed: no burst was started
}
[Fact]
@ -266,7 +266,7 @@ public sealed class IffAndCombatTests : IDisposable
weapon.Activate();
Assert.Equal(1f, weapon.Progress); // Trigger() ran: cooldown/burst started
Assert.False(weapon.CanFire); // Trigger() ran: a burst is pending
}
[Fact]
@ -279,7 +279,7 @@ public sealed class IffAndCombatTests : IDisposable
weapon.Activate();
Assert.Equal(1f, weapon.Progress);
Assert.False(weapon.CanFire); // Trigger() ran: a burst is pending
}
[Fact]