ThinkInvis / RoR2-TinkersSatchel

A mod for Risk of Rain 2.
GNU General Public License v3.0
4 stars 4 forks source link

Fix logic in Scavenger's Rucksack #68

Closed SSM240 closed 1 year ago

SSM240 commented 1 year ago

Currently there's an issue where the Scavenger's Rucksack won't properly reset itself, because of an erroneous check that isStopped is false before setting to false. The consequence of this is a little hard to fully explain, but basically, once you've started cycling through equipment, it'll never exit the state of trying to cycle through equipment - it'll always increment and check shuffleStopwatch (rather than stationaryStopwatch) when you're stopped, and never actually reset it when you start moving again.

Simply removing this extra if(!isStopped) check fixes the logic here, causing the item to properly reset its state whenever you start moving again. This kind of check was never necessary in the first place, because the else block will only ever run when you're moving anyway.

ThinkInvis commented 1 year ago

Thanks for catching this! The check for isStopped is intentional as a micro-optimization, however (1 boolean check vs. 3 variable assignments per tick); it's just the ! that needs to be removed. Fixed as such in v3.6.0.