Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cards: no drawing from objects in-hand into the same object. #2038

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Content.Shared/_EstacaoPirata/Cards/Stack/CardStackSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ private void OnInteractUsing(InteractUsingEvent args)
if (args.Handled)
return;

if (args.Target == args.Used)
return;

// This checks if the user is using an item with Stack component
if (TryComp(args.Used, out CardStackComponent? usedStack))
{
Expand Down Expand Up @@ -432,6 +435,10 @@ private void OnActivate(EntityUid uid, CardStackComponent component, ActivateInW
{
OnInteractHand(args.Target, component, args.User);
}
else if (activeItem == args.Target)
{
return;
}
else if (TryComp<CardStackComponent>(activeItem, out var cardStack))
{
TransferNLastCardFromStacks(args.User, 1, args.Target, component, activeItem.Value, cardStack);
Expand Down
Loading