Quick fixes for markings (#7963)

This commit is contained in:
Flipp Syder
2022-05-05 20:38:51 -07:00
committed by GitHub
parent 232da10789
commit d332c829e8
2 changed files with 13 additions and 2 deletions

View File

@@ -47,7 +47,10 @@ namespace Content.Client.Markings
foreach (var marking in markingList)
{
markings.ActiveMarkings[_markingManager.Markings()[marking.MarkingId].BodyPart].Add(marking);
if (_markingManager.Markings().TryGetValue(marking.MarkingId, out var markingProto))
{
markings.ActiveMarkings[markingProto.BodyPart].Add(marking);
}
}
}
@@ -69,6 +72,14 @@ namespace Content.Client.Markings
continue;
}
// if the given marking isn't correctly formed, we need to
// instead just allocate a new marking based on the old one
// with the correct sprite count
if (marking.MarkingColors.Count != markingPrototype.Sprites.Count)
{
marking = new Marking(marking.MarkingId, markingPrototype.Sprites.Count);
}
if (usedPoints.TryGetValue(markingPrototype.MarkingCategory, out MarkingPoints? points))
{
if (points.Points == 0)