Skip to content

Commit

Permalink
Fix statesource overwriting data for characterweapon.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ottermandias committed Jul 20, 2024
1 parent 94b7ea2 commit a7f36da
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Glamourer/Interop/Material/MaterialValueManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ static void Set<T>(ref T target, T? value)
}
}

[StructLayout(LayoutKind.Explicit)]
public struct MaterialValueState(
in ColorRow game,
in ColorRow model,
Expand All @@ -187,17 +186,10 @@ public MaterialValueState(in ColorRow gameRow, in ColorRow modelRow, CharacterAr
: this(gameRow, modelRow, armor.ToWeapon(0), source)
{ }

[FieldOffset(0)]
public ColorRow Game = game;

[FieldOffset(44)]
public ColorRow Model = model;

[FieldOffset(88)]
public ColorRow Game = game;
public ColorRow Model = model;
public readonly CharacterWeapon DrawData = drawData;

[FieldOffset(95)]
public readonly StateSource Source = source;
public readonly StateSource Source = source;

public readonly bool EqualGame(in ColorRow rhsRow, CharacterWeapon rhsData)
=> DrawData.Skeleton == rhsData.Skeleton
Expand Down

0 comments on commit a7f36da

Please sign in to comment.