Introduced locks, if nessisary for change.

This commit is contained in:
Cordelia Mist 2025-01-24 11:44:09 -08:00
parent 611200d311
commit 0f127a557d

View file

@ -144,8 +144,11 @@ public class ItemsApi(ApiHelpers helpers, ItemManager itemManager, StateManager
// Grab MetaIndices from attached flags, and update the states.
var indices = metaStates.ToIndices();
foreach (var index in indices)
stateManager.ChangeMetaState(state, index, newValue, ApplySettings.Manual);
foreach (var index in indices)
{
stateManager.ChangeMetaState(state, index, newValue, ApplySettings.Manual);
ApiHelpers.Lock(state, key, flags);
}
return GlamourerApiEc.Success;
}
@ -172,8 +175,11 @@ public class ItemsApi(ApiHelpers helpers, ItemManager itemManager, StateManager
anyUnlocked = true;
// update all MetaStates for this ActorState
foreach (var index in indices)
stateManager.ChangeMetaState(state, index, newValue, ApplySettings.Manual);
foreach (var index in indices)
{
stateManager.ChangeMetaState(state, index, newValue, ApplySettings.Manual);
ApiHelpers.Lock(state, key, flags);
}
}
if (!anyFound)