public static bool PreRouteNearEntranceAndIntoBuilding(GoToSchoolInRabbitHole ths, bool canUseCar, Route.RouteMetaType routeMetaType, OnChangeOutfit changedOutfitFunc) { try { // From GoToSchoolInRabbitHole GoToSchoolInRabbitHole.Definition interactionDefinition = ths.InteractionDefinition as GoToSchoolInRabbitHole.Definition; if ((interactionDefinition != null) && (interactionDefinition.PlayerChosenVehicle != null)) { ths.Actor.SetReservedVehicle(interactionDefinition.PlayerChosenVehicle); } bool success = false; School school = ths.Actor.School; if (school != null) { SimOutfit outfit; if (school.TryGetUniformForCurrentLevel(out outfit)) { if (ApplyOccupationUniform(ths.Actor.SimDescription, outfit)) { success = true; } } } if ((!success) && (changedOutfitFunc != null)) { changedOutfitFunc(); } VisitSituation.OnSimLeavingLot(ths.Actor); // From RabbitHoleInteraction<TActor, TRabbitHole> return true; } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(ths.Actor, ths.Target, e); return false; } }
public static bool PreRouteNearEntranceAndIntoBuilding(GoToSchoolInRabbitHole ths, bool canUseCar, Route.RouteMetaType routeMetaType, OnChangeOutfit changedOutfitFunc) { try { // From GoToSchoolInRabbitHole GoToSchoolInRabbitHole.Definition interactionDefinition = ths.InteractionDefinition as GoToSchoolInRabbitHole.Definition; if ((interactionDefinition != null) && (interactionDefinition.PlayerChosenVehicle != null)) { ths.Actor.SetReservedVehicle(interactionDefinition.PlayerChosenVehicle); } bool success = false; School school = ths.Actor.School; if (school != null) { SimOutfit outfit; if (school.TryGetUniformForCurrentLevel(out outfit)) { if (ApplyOccupationUniform(ths.Actor.SimDescription, outfit)) { success = true; } } } if ((!success) && (changedOutfitFunc != null)) { changedOutfitFunc(); } VisitSituation.OnSimLeavingLot(ths.Actor); // From RabbitHoleInteraction<TActor, TRabbitHole> return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(ths.Actor, ths.Target, e); return(false); } }