elunna / hackem

SlashEM forked Unto Evil with a Splice of X and a dash of THEM.
Other
23 stars 8 forks source link

Don't re-throw windrider if it didn't make it back. #532

Closed ksylvie365 closed 7 months ago

ksylvie365 commented 7 months ago

The problem

Boomerangs normally multi-shot the normal way by having a stack of them, but it appears that Windrider aims to be able to do this with only a stack of one if it makes it back to the player. However, if a multi shot check is passed (e.g. m_shot.n > 1), then it will try fire twice regardless of whether it makes it back to player inventory or not. If it doesn't, it tries to remove it from player inventory when it is actually on the ground somewhere, leading to the panic.

Possible Fix

I noticed that obj::was_thrown is set IFF the item was recently thrown and it hasn't been picked back up. This seems like an easy check to halt multi shot that doesn't require an inventory LL traversal or passing around extra state from zap.c:boomhit. If this an abuse of the was_thrown flag, however, it may make sense to do one of the other two options.