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

Move away from walls on evolve #1484

Merged

Conversation

necessarily-equal
Copy link
Contributor

🎉

@necessarily-equal
Copy link
Contributor Author

Test procedure:

/team a
/class level0
go to a corner or too close to a wall
/class level4
tada, you sucessfully evolved!

Note that if you go to a corner with things on both side, like in a corner of the alien base in chasm, you may actually not have enough place to evolve: this will not "jump" to allow you to evolve. If you have a corner like this:

\  |
 \ |
  \|

It won't try to "climb". I think those should be corner cases (hehe).

This voluntarily doesn't handle cases where you are under a pipe or similar, and try to evolve anyway.

Copy link
Contributor

@slipher slipher left a comment

Choose a reason for hiding this comment

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

Great, fixing the inconvenience which was there since Tremulous.

src/sgame/sg_cmds.cpp Outdated Show resolved Hide resolved
src/sgame/sg_cmds.cpp Outdated Show resolved Hide resolved
src/sgame/sg_cmds.cpp Outdated Show resolved Hide resolved
@necessarily-equal
Copy link
Contributor Author

necessarily-equal commented Sep 11, 2021

Ok, I found a bug [EDIT: now fixed].

How to break it:

  • open plat23
  • go in the corner with the overmind and the egg (the "innermost" part of the base)
  • evolve to tyrant

Screenshot from 2021-09-11 20-43-22

You're then stuck colliding with the egg, and can't move.

@slipher
Copy link
Contributor

slipher commented Sep 12, 2021

Well it looks like the "vertically" function is supposed to make the final decision on whether evolving is allowed, but in the lateral movement case you forgot to actually call it.

@slipher
Copy link
Contributor

slipher commented Sep 15, 2021

Fixes #480 !

@necessarily-equal necessarily-equal marked this pull request as draft September 30, 2021 22:02
(also split in two functions to prepare for the next commit)
Copy link
Contributor Author

@necessarily-equal necessarily-equal left a comment

Choose a reason for hiding this comment

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

The bug I reported earlier on this PR is now fixed. The code is now a few lines longer but this time I didn't manage to break it 😆

src/sgame/sg_cmds.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@slipher slipher left a comment

Choose a reason for hiding this comment

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

Is it intentional that the stuff fiddling with vertical position is skipped when there is a nonzero lateral displacement?

src/sgame/sg_cmds.cpp Outdated Show resolved Hide resolved
@necessarily-equal
Copy link
Contributor Author

Is it intentional that the stuff fiddling with vertical position is skipped when there is a nonzero lateral displacement?

yes, it is: if the lateral displacement finds a spot, then it is known valid. I guess we could push the player towards the ground, but that wouldn't be needed on slopes. So only large steps could benefit from this and it wouldn't be worth it.

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.

None yet

4 participants