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 interaction when pushing character off of falling tile #563

Merged
merged 3 commits into from Dec 28, 2023

Conversation

Hypexion
Copy link
Contributor

@Hypexion Hypexion commented Dec 8, 2023

If a falling tile such as a trapdoor drops by having an monster pushed off of it, it is possible for the pushing entity to end up on an otherwise impassable pit or water tile. This is inconsistent with other situations where a tile is altered to pit or water beneath an entity, which can lead to them dropping or drowning.

To fix, monsters now set a flag bPushedOtherMonster when they body push a monster. If this flag is set after their movement is processed, monsters that can push other monsters will call CDbRoom::CheckForFallingAt at their new position. This will cause them to drop if their destination tile is unsuitable. CCurrentGame::ProcessPlayer has had a similar change made to allow the same for player movement.

@@ -105,7 +105,7 @@ CMonster::CMonster(
, bAlive(true)
, bForceWeaponAttack(false)
, stunned(0), bNewStun(false)
, bPushedThisTurn(false)
, bPushedThisTurn(false), bPushedOtherMonster(false)
Copy link
Member

Choose a reason for hiding this comment

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

Suggest we reset this var in CMonster::Clear().

@mrimer mrimer merged commit aaf9606 into CaravelGames:tss-5.2-dev Dec 28, 2023
@Hypexion Hypexion deleted the fix-push-fall-interaction branch December 28, 2023 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants