Fix kitchen spike (#4008)

* Fix kitchen spike

* Add fluent localization

* Add newline

* Prevent things that are not dead from being spiked
This commit is contained in:
ShadowCommander
2021-05-17 02:12:17 -07:00
committed by GitHub
parent 09ebbbc02d
commit b907c54470
3 changed files with 45 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
#nullable enable
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Mobs.State;
using Content.Shared.GameObjects.Components.Nutrition;
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects;
@@ -23,15 +24,13 @@ namespace Content.Shared.Kitchen
bool IDragDropOn.CanDragDropOn(DragDropEventArgs eventArgs)
{
if (eventArgs.User == eventArgs.Dragged ||
!eventArgs.Dragged.TryGetComponent<IMobStateComponent>(out var state) ||
(eventArgs.User.TryGetComponent(out SharedCombatModeComponent? combatMode) && !combatMode.IsInCombatMode))
if (!eventArgs.Dragged.HasComponent<SharedButcherableComponent>())
{
return false;
}
// TODO: Once we get silicons need to check organic
return !state.IsDead();
return true;
}
public abstract bool DragDropOn(DragDropEventArgs eventArgs);