fix bashable furnitures not bashable by monsters #1900
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Purpose of change
Fix #1691
When a monster tries to reach the player, but has a bashable furniture that he can bash on his path, he'll try to bash it endlessly.
But the function used to bash the terrain/furniture has some bug that don't allow the monster to bash it.
More precisely, the function checks if the terrain is flat/is a road, then if it's bashable, and will stop the bashing attempt if it isn't. But it doesn't check if there is a bashable furniture on it.
This can be observed with a zombie soldier/zombie hulk and a large canvas door/animal skin wall/cardboard wall on a flat terrain
Describe the solution
Fix the function so it checks if there's is a bashable furniture on the terrain before stoping the bashing attempt.
Testing
In the same situation as the bug report, fixing the function made the zombie bash the wall at will