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

Add cassette fly check to Player.OnSquish #846

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bigkahuna443
Copy link
Contributor

The cassette fly state is intended to make the player invincible, but at the moment squish checks are still made against the player. This can cause deaths in modded situations when the return path crosses e.g. block entities.

This patch adds a check at the start of OnSquish to return immediately if the player is in the CassetteFly state.

Here is an example of the behavior before the change and after the change.

(This change was made manually in SJ and I thought it'd be helpful to add into Everest as a whole)

The cassette fly state is intended to make the player invincible, but at the moment squish checks are still made against the player. This can cause deaths in modded situations when the return path crosses e.g. block entities.

This path adds a check at the start of OnSquish to return immediately if the player is in the CassetteFly state.
Copy link
Member

@microlith57 microlith57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me; unlikely to collide with the sj ilhook (though i assume you've tested that)

cursor.EmitLdarg(0);
cursor.EmitLdfld(f_Player_StateMachine);
cursor.EmitCallvirt(m_StateMachine_get_State);
cursor.EmitLdcI4(21);
Copy link
Member

@microlith57 microlith57 Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nitpick:

Suggested change
cursor.EmitLdcI4(21);
cursor.EmitLdcI4(21 /* StCassetteFly */);

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.

2 participants