DerpleMQ2 / rgmercs

Lua version of RGMercs Script
10 stars 20 forks source link

The Berserker summons 20 more axes than requested (version 2024-04-16) #35

Closed JoeBostic closed 4 months ago

JoeBostic commented 4 months ago

The Berserker class summons axes (if the other bug I reported is fixed), but it summons 20 more than requested. Looking at the code it appears to be a natural cause of having a loop and the summon axe ability taking time (like a spell) to summon 20 axes. The code does call the summon axe and then calls autoinventory, but the axes have not yet been summoned, so I presume that the next time around, the axes (which are now in the mouse cursor from the previous summon) get dropped into inventory by the autoinventory command. If the code knew that it was summoning axes and could detect if any were in the mouse cursor, then the exact number requested could be summoned. An easier solution is to just subtract 20 from the requested axe summoning number and it will end up summoning the correct amount most of the time. "Most of the time" means about 19 times out of 20 due to how the math works out.

Note: The macro version of RGMercs had this same issue.

DerpleMQ2 commented 4 months ago

https://github.com/DerpleMQ2/rgmercs/commit/c45a848f38fe4ef98f78920dc8fb9166c11624f7