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

autosell A #11

Merged
merged 2 commits into from
Jun 9, 2020
Merged

autosell A #11

merged 2 commits into from
Jun 9, 2020

Conversation

FluffyDiscord
Copy link
Contributor

added autosell option A for now
#9

@JavidPack
Copy link
Owner

Just took a quick look, but did you take into account that the player can take the item out of the slot, drop it on the ground, then pick it up to get the sell price again? Looking at your code, I think that exploit is possible, you may have to take money from the player to allow them to take the item out of the slot.

If you aren't sure how to do that, I can do that when I have time to make the release.

@FluffyDiscord
Copy link
Contributor Author

FluffyDiscord commented Jun 7, 2020

well, clearly I did not 🤦, I will try something reasonable tomorrow

@FluffyDiscord
Copy link
Contributor Author

Just tested your note regarding possible exploit, but it looks like it can not be done. Removing item from the item slot removes it from the item list. So then throwing it on the ground just makes the player pick it up normally and puts it in normal inventory slot. It works just like the AutoTrash.

I just modified a bit of your code to allow selling and added little icon to reflect the selected mode, nothing major tbh.

Should be just fine to be released

@JavidPack
Copy link
Owner

The exploit can actually still be done with stackable items if you auto trash 1 item, then pick up a stack you throw on the ground, and repeat.

I fixed it, and made it so you get money for the initial trash item as well

Thanks a lot for this, you really helped out.

@JavidPack JavidPack merged commit bdc5f3a into JavidPack:master Jun 9, 2020
@JavidPack
Copy link
Owner

Also, just so you are aware, previously you were dividing the value by the sell value, but that math isn't correct. You can see my edits to fix that math.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants