Fix bug that made getting the arousal zone for the ItemFeet group impossible

This commit is contained in:
Jean-Baptiste Emmanuel Zorg 2025-04-09 00:56:54 +02:00
parent 963097b98b
commit 0f1c0ac11d

View file

@ -192,7 +192,7 @@ function PreferenceGetArousalZone(C, ZoneName) {
// Finds the asset group and make sure the string contains it
let Group = AssetGroupGet(C.AssetFamily, ZoneName);
if (!Group?.ArousalZoneID || (C.ArousalSettings.Zone.length <= Group.ArousalZoneID)) return null;
if (!Group || !CommonIsNonNegativeInteger(Group.ArousalZoneID) || (C.ArousalSettings.Zone.length <= Group.ArousalZoneID)) return null;
const Value = C.ArousalSettings.Zone.charCodeAt(Group.ArousalZoneID) - 100;
let Factor = /** @type {ArousalFactor} */ (CommonClamp(Value, 0, 4));