fix(movement): invalidate burden on enchantment changes

This commit is contained in:
Erik 2026-07-31 10:16:27 +02:00
parent 2b9dfec9d7
commit d6e8b60303
13 changed files with 231 additions and 25 deletions

View file

@ -229,6 +229,10 @@ public sealed class LiveSessionEventRouter : ILiveSessionEventRouting
if (kind == LocalPlayerState.AttributeKind.Strength)
RecomputeBurden(inventory, character);
});
SubscribeParameterless(
h => character.Character.Spellbook.EnchantmentsChanged += h,
h => character.Character.Spellbook.EnchantmentsChanged -= h,
() => RecomputeBurden(inventory, character));
// Current-stamina push — CACQualities::InqRunRate/InqJumpVelocity's
// stamina==0 effective-skill-zeroing gate (pseudocode doc §5).
@ -370,8 +374,8 @@ public sealed class LiveSessionEventRouter : ILiveSessionEventRouting
{
uint player = inventory.PlayerGuid();
ClientObject? playerObject = inventory.Objects.Get(player);
int strength = (int)(character.Character.LocalPlayer
.GetAttribute(LocalPlayerState.AttributeKind.Strength)?.Current ?? 0u);
int strength = character.Character.LocalPlayer
.GetEffectiveAttribute(LocalPlayerState.AttributeKind.Strength) ?? 0;
int aug = playerObject?.Properties.GetInt(
(uint)PropertyInt.AugmentationIncreasedCarryingCapacity) ?? 0;
int capacity = EncumbranceSystem.EncumbranceCapacity(strength, aug);