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

Fix dropping of items and digging after letting go from scale/hangle #120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fritzw
Copy link

@fritzw fritzw commented Mar 28, 2024

Fixes #119.

Dropping items when letting go from scaling was just the missing break.

The hangle case is a bit more complicated because the drop command is initiated by checking LastComDownDouble, which is set based on LastCom. So by clearing LastCom when letting go, the problem goes away. Dropping items after landing as before is still possible by pressing Down-Down-Throw again while in the air instead of just Down-Throw as before.

I'm not sure if the if in line 3548 is really necessary, because ObjectComLetGo can only return false for an object which can scale/hangle but has no "Jump" action, so it can not let go. At that point, we can as well leave LastCom alone, I guess, maybe the object wants to do something special with it...

Weapons were not tested, and I'm unsure if there are any weird interactions with scripts or other custom content.

@fritzw
Copy link
Author

fritzw commented Mar 28, 2024

Maybe a static function with three arguments for cObj, xdir, pPlayer would be more performant than a lambda. On the other hand, both the lambda and the static function are probably inlined by the compiler anyway, since the lambda does not leave the scope, so meh...

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.

Possible Bug: Pressing Dig while climbing drops item in addition to letting go, with jump and run control
2 participants