Skip to content

Commit

Permalink
Fixes Broken Heights/Widths (#1390)
Browse files Browse the repository at this point in the history
# Description

I broke some things

# Changelog

:cl: Mocho
- fix: Fixed heights/widths being broken due to the shitmed patch.
  • Loading branch information
gluesniffler authored Jan 1, 2025
1 parent 280aa4b commit d0ea387
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Content.Client/Humanoid/HumanoidAppearanceSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
Expand Down Expand Up @@ -30,6 +31,15 @@ private void UpdateSprite(HumanoidAppearanceComponent component, SpriteComponent
UpdateLayers(component, sprite);
ApplyMarkingSet(component, sprite);

var speciesPrototype = _prototypeManager.Index(component.Species);

var height = Math.Clamp(component.Height, speciesPrototype.MinHeight, speciesPrototype.MaxHeight);
var width = Math.Clamp(component.Width, speciesPrototype.MinWidth, speciesPrototype.MaxWidth);
component.Height = height;
component.Width = width;

sprite.Scale = new Vector2(width, height);

sprite[sprite.LayerMapReserveBlank(HumanoidVisualLayers.Eyes)].Color = component.EyeColor;
}

Expand Down Expand Up @@ -199,6 +209,8 @@ public override void LoadProfile(EntityUid uid, HumanoidCharacterProfile? profil
humanoid.Species = profile.Species;
humanoid.SkinColor = profile.Appearance.SkinColor;
humanoid.EyeColor = profile.Appearance.EyeColor;
humanoid.Height = profile.Height;
humanoid.Width = profile.Width;

UpdateSprite(humanoid, Comp<SpriteComponent>(uid));
}
Expand Down

0 comments on commit d0ea387

Please sign in to comment.