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

Fix being able to dupe items via Machine Access Interface #1021

Merged
merged 5 commits into from
Aug 18, 2022

Conversation

ALongStringOfNumbers
Copy link
Contributor

What:
Fixes being able to dupe machines with the Machine Access Interface as shown in #1008

Implementation Details:
The dupe was occurring because of the super.insertItems call in the MetatileEntityMachineHatch item handler returning the stack when attempting to insert into a slot that had reached/exceeded its slot limit.

This fix simply sets the base slot limit of the Machine Access Interface to 16 (The amount for a regular Processing Array). The fix was done this way to also prevent people from attempting to cheese things, by placing a stack of machines into a Machine Access Interface attached to an unformed PA, and then forming the PA, thus having 1 stack of machines when the PA is only supposed to handle 16.

This works around the problematic behavior when the amount in the slot was greater than the slot limit.

Outcome:
Fixes being able to dupe machines in the Machine Access Interface. Closes #1008

@Exaxxion
Copy link
Contributor

Exaxxion commented Jun 8, 2022

Seems prudent enough, though I do have one concern: have you tried forming an advanced PA, then without breaking the machine hatch, forming a basic PA with that hatch and trying the dupe exploit again?

Copy link
Member

@Quarri6343 Quarri6343 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it in game and found it does not fix anything
you still can reproduce #1008 with following steps:

  1. form Advanced PA
  2. put 64 machines into Machine Access Interface
  3. unform Advanced PA
  4. open Interface UI and shift click the machine in your inventory

@ALongStringOfNumbers ALongStringOfNumbers added the status: do not merge PR should not be merged label Jun 27, 2022
@ALongStringOfNumbers
Copy link
Contributor Author

@Quarri6343 Could you try this again? I believe I have gotten it working correctly, at least I could not reproduce the issue when I tried.

@ALongStringOfNumbers ALongStringOfNumbers added the type: bug Something isn't working label Jul 20, 2022
@IntegerLimit
Copy link
Contributor

If this keeps happening, I do have one idea. A advanced machine access interface could be added, which must be used for the advanced PA, and cannot be used for the normal PA. Since the stack of machines had to be allowed in the machine access interface because of the advanced PA, this should make it so that the machine access interface would not need to allow more than 16 machines.

@ALongStringOfNumbers ALongStringOfNumbers removed the status: do not merge PR should not be merged label Jul 28, 2022
@ALongStringOfNumbers ALongStringOfNumbers merged commit 6b90a5f into master Aug 18, 2022
@ALongStringOfNumbers ALongStringOfNumbers deleted the machine-hatch-fix branch August 18, 2022 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Machine Access Interface can dupe machines
5 participants