Skip to content

Commit

Permalink
Fix hair OOB indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Jan 23, 2022
1 parent fd36216 commit 32bb5c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Procedurline/Player/Hair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ HairOverride DetermineOverride(PlayerHair hair) {
int numNodes = ov?.StyleData.ScaleMultipliers.Length ?? origCount;
if(!m.IsConstructor && hair.Nodes.Count != numNodes) {
//Update nodes
while(hair.Nodes.Count > numNodes) hair.Nodes.RemoveAt(hair.Nodes.Count);
while(hair.Nodes.Count < numNodes) hair.Nodes.Add(hair.Nodes[hair.Nodes.Count-1]);
while(hair.Nodes.Count > numNodes) hair.Nodes.RemoveAt(hair.Nodes.Count-1);
while(hair.Nodes.Count < numNodes) hair.Nodes.Add((hair.Nodes.Count > 0) ? hair.Nodes[hair.Nodes.Count-1] : Vector2.Zero);
}

return numNodes;
Expand Down

0 comments on commit 32bb5c8

Please sign in to comment.