fix(CS): send crown shield packet (0xB2/0x16) only on change, not every tick
Some checks failed
.NET Core / build (push) Has been cancelled

The shield packet pops a modal message box on the client; sending it every tick
re-opened the modal continuously and froze player input at siege start. Track the
shield state in the context and only push the packet when it actually flips.
This commit is contained in:
Acentech Dev
2026-07-15 15:36:51 +03:00
parent 3dd4881406
commit e5dfa24585
2 changed files with 19 additions and 8 deletions

View File

@@ -428,7 +428,12 @@ public sealed class CastleSiegeEventPlugIn : IPeriodicTaskPlugIn, ISupportCustom
return;
}
await player.InvokeViewPlugInAsync<ICastleSiegeStatusViewPlugIn>(p => p.SetCrownShieldAsync(crown.ShieldDown)).ConfigureAwait(false);
// Only tell the client when the shield state actually flips — the 0xB2/0x16 packet pops a modal
// message box, so sending it every tick would block player input.
if (crown.ShieldChanged)
{
await player.InvokeViewPlugInAsync<ICastleSiegeStatusViewPlugIn>(p => p.SetCrownShieldAsync(crown.ShieldDown)).ConfigureAwait(false);
}
switch (crown.Event)
{