Fix a crash when the player somehow becomes invalid

It's unclear what's causing it, but people have been reporting crashes
in the wardrobe, so let's stay safe and protect against a possibly
missing Player object.
This commit is contained in:
Jean-Baptiste Emmanuel Zorg 2025-03-30 00:50:11 +01:00
parent 1a185e0318
commit baa480a3b3

View file

@ -595,7 +595,7 @@ function CharacterAppearanceSetHeightModifiers(C) {
}
// Set the height ratio here to avoid lookin it up when drawing. The setting can make all characters full height
C.HeightRatio = Player.CharacterID === "" || Player.VisualSettings.ForceFullHeight ? 1 : CharacterAppearanceGetCurrentValue(C, "Height", "Zoom");
C.HeightRatio = Player.VisualSettings?.ForceFullHeight ? 1 : CharacterAppearanceGetCurrentValue(C, "Height", "Zoom");
}
/**