Adds validation bool for setting humanoid skin color (#15360)
This commit is contained in:
@@ -144,8 +144,9 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
/// <param name="uid">The humanoid mob's UID.</param>
|
||||
/// <param name="skinColor">Skin color to set on the humanoid mob.</param>
|
||||
/// <param name="sync">Whether to synchronize this to the humanoid mob, or not.</param>
|
||||
/// <param name="verify">Whether to verify the skin color can be set on this humanoid or not</param>
|
||||
/// <param name="humanoid">Humanoid component of the entity</param>
|
||||
public virtual void SetSkinColor(EntityUid uid, Color skinColor, bool sync = true, HumanoidAppearanceComponent? humanoid = null)
|
||||
public virtual void SetSkinColor(EntityUid uid, Color skinColor, bool sync = true, bool verify = true, HumanoidAppearanceComponent? humanoid = null)
|
||||
{
|
||||
if (!Resolve(uid, ref humanoid))
|
||||
return;
|
||||
@@ -155,7 +156,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SkinColor.VerifySkinColor(species.SkinColoration, skinColor))
|
||||
if (verify && !SkinColor.VerifySkinColor(species.SkinColoration, skinColor))
|
||||
{
|
||||
skinColor = SkinColor.ValidSkinTone(species.SkinColoration, skinColor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user