Grow lesson skills only when the assigned teacher is standing in the room.

The timetable already named a teacher; learning ignored whether they were in the toilet, still walking, or not a person at all.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 08:33:28 +03:00
co-authored by Cursor
parent 936d6fb04f
commit fbc32f2bfc
9 changed files with 312 additions and 18 deletions
+9
View File
@@ -14,6 +14,7 @@ public static class PersonLogTypes
public const string ActionEnded = "action-ended";
public const string ApparelReplaced = "apparel-replaced";
public const string ApparelChanged = "apparel-changed";
public const string LessonNoTeacher = "lesson-no-teacher";
}
/// <summary>
@@ -58,6 +59,14 @@ public sealed record PersonLogEvent(string PersonId, DateTime Time, string Type,
return string.Format(CultureInfo.InvariantCulture, catalog.Text(locale, key), name);
}
if (Type.Equals(PersonLogTypes.LessonNoTeacher, StringComparison.Ordinal))
{
var name = catalog.Subjects.TryGetValue(ThingDef, out var subject)
? catalog.Label(locale, subject)
: ThingDef;
return string.Format(CultureInfo.InvariantCulture, catalog.Text(locale, "LessonNoTeacher"), name);
}
return Type;
}
}