Maybe fix weapon hidden state when leaving gpose or changing zones.

This commit is contained in:
Ottermandias 2024-08-13 15:27:32 +02:00
parent 38a489d7f0
commit a7c5d513d4
4 changed files with 11 additions and 4 deletions

View file

@ -247,8 +247,13 @@ public class StateApplier(
}
case MetaIndex.WeaponState:
{
foreach (var actor in data.Objects.Where(a => a.IsCharacter))
_metaService.SetWeaponState(actor, value);
// Only apply to the GPose character because otherwise we get some weird incompatibility when leaving GPose.
if (_objects.IsInGPose)
foreach (var actor in data.Objects.Where(a => a.IsGPoseOrCutscene))
_metaService.SetWeaponState(actor, value);
else
foreach (var actor in data.Objects.Where(a => a.IsCharacter))
_metaService.SetWeaponState(actor, value);
return;
}
case MetaIndex.VisorState:

View file

@ -251,7 +251,7 @@ public class StateEditor(
var actors = Applier.ChangeMetaState(state, index, settings.Source.RequiresChange());
Glamourer.Log.Verbose(
$"Set Head Gear Visibility in state {state.Identifier.Incognito(null)} from {old} to {value}. [Affecting {actors.ToLazyString("nothing")}.]");
$"Set {index.ToName()} in state {state.Identifier.Incognito(null)} from {old} to {value}. [Affecting {actors.ToLazyString("nothing")}.]");
StateChanged.Invoke(StateChangeType.Other, settings.Source, state, actors, new MetaTransaction(index, old, value));
}