Simplify and improve the logic for passability calculations #9404
+47
−23
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.
This pull request fixes multiple places with object passabilities:
This is how single tile Mandrake's passability look like in the original Editor (highlighted by a yellow color):
Notice that dark red tiles are for object parts while grey color is used for shadows. All other objects have the correct layer type.
A tile with top part of Oasis object was not being updated properly.
This is how Oasis's passability is shown in the original Editor (highlighted by a yellow color):
Somehow, in the original game the top tiles of Oasis are passable o_O
one variant of Rock object has a shadow part being marked as object layer in the original Editor (highlighted by a yellow color):
tiles with no objects or objects that do not affect passability must not be affected by a tile below. This isn't true in the original game but it led to broken gameplay, like Colossal Cavern map.
This is how it looks on master branch and in the original game:
and this is how it looks in this branch:
The tile which is pointed by cursor has no objects except shadows but somehow it was marked as impassible.
(*) only tiles which have different passability were being tested on the OG
How differences in passabilities were detected:
const std::string saveFilePrefix = "_new";