Sample outdoor weather from the climate preset so people can freeze and the clock can show it.
Protocol v8 adds tenths of a °C and precipitation to the clock frame; warmth drains from insulation versus place temperature. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,6 +30,11 @@ internal static class PeopleDefValidator
|
||||
ValidateCountry(country, catalog);
|
||||
}
|
||||
|
||||
foreach (var preset in catalog.ClimatePresets.Values)
|
||||
{
|
||||
ValidateClimatePreset(preset);
|
||||
}
|
||||
|
||||
foreach (var subject in catalog.Subjects.Values)
|
||||
{
|
||||
ValidateSubject(subject, catalog);
|
||||
@@ -576,6 +581,40 @@ internal static class PeopleDefValidator
|
||||
ValidateNameSet(country.Names ?? new NameSetDef(), catalog, country.DefName);
|
||||
}
|
||||
|
||||
private static void ValidateClimatePreset(ClimatePresetDef preset)
|
||||
{
|
||||
if (preset.Abstract)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (preset.MonthlyNorms.Count != 12)
|
||||
{
|
||||
throw new ContentLoadException(
|
||||
$"ClimatePresetDef '{preset.DefName}' monthlyNorms must list 12 months.");
|
||||
}
|
||||
|
||||
if (preset.DaySpread < 0 || preset.HourSpread < 0)
|
||||
{
|
||||
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' spreads cannot be negative.");
|
||||
}
|
||||
|
||||
if (preset.PrecipitationChance < 0 || preset.PrecipitationChance > 1)
|
||||
{
|
||||
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' precipitationChance must be 0–1.");
|
||||
}
|
||||
|
||||
if (preset.ComfortHalfWidthC < 0)
|
||||
{
|
||||
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' comfortHalfWidthC cannot be negative.");
|
||||
}
|
||||
|
||||
if (preset.InsulationPerC < 0)
|
||||
{
|
||||
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' insulationPerC cannot be negative.");
|
||||
}
|
||||
}
|
||||
|
||||
private static void ValidateNameSet(NameSetDef names, DefCatalog catalog, string countryDefName)
|
||||
{
|
||||
if (!NameGrammar.IsKnownPatronymic(names.PatronymicRule))
|
||||
|
||||
Reference in New Issue
Block a user