Various cow fixes (#18602)

Reparent cow outputs to the correct grid.

Adjust produce so that cows and other multi-stomached animals can eat most produce.

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-08-04 08:15:05 +01:00
committed by GitHub
parent b74bd10c32
commit e05bac1c15
4 changed files with 13 additions and 5 deletions

View File

@@ -21,15 +21,16 @@ namespace Content.Server.Nutrition.EntitySystems;
/// </summary>
public sealed class AnimalHusbandrySystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly HungerSystem _hunger = default!;
[Dependency] private readonly IAdminLogManager _adminLog = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly HungerSystem _hunger = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
private readonly HashSet<EntityUid> _failedAttempts = new();
@@ -197,6 +198,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
foreach (var spawn in spawns)
{
var offspring = Spawn(spawn, xform.Coordinates.Offset(_random.NextVector2(0.3f)));
_transform.AttachToGridOrMap(offspring);
if (component.MakeOffspringInfant)
{
var infant = AddComp<InfantComponent>(offspring);