jokeruarwentto / AutoPickup

Automatically pickup items near you without needing to right click on it.
1 stars 0 forks source link

v1.2.0 - Pickup Distance Won't Change #6

Closed Snaitf closed 2 years ago

Snaitf commented 2 years ago

Even with pickup distance set in the cfg, and using F2 to change the distance, the actual distance doesn't change. It will pickup items from very far away. With my limited knowledge of coding, I think the problem is here.

https://github.com/jokeruarwentto/AutoPickup/blob/5487d527158824369df4237da9965355b60f27bc/src/Plugin.cs#L67

Shouldn't this line use a variable instead of a hard coded distance? I could be completely wrong, mind you, lol. Thanks for working to help improve our gaming experience. :)

EDIT: I changed that line to

item.transform.position) <= _distances[_currentDistance]))

And that seems to fix it.

Also, I noticed that _currentDistance is always zero when the game loads, it doesn't get set via the config. So I added this to Awake()

_currentDistance = (int)_distance.Value;

Not sure if that's preferred/clean way of doing those, but it seems to work as intended now. ;)

Snaitf commented 2 years ago

nevermind, both issues fixed as of 2.0.0