File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -790,24 +790,30 @@ void Maps::Tile::updatePassability()
790
790
const MP2::MapObjectType correctedObjectType = MP2::getBaseActionObjectType ( bottomTileObjectType );
791
791
792
792
if ( MP2::isOffGameActionObject ( bottomTileObjectType ) || MP2::isOffGameActionObject ( correctedObjectType ) ) {
793
- if ( ( bottomTile.getTileIndependentPassability () & Direction::TOP ) == 0 ) {
794
- if ( isShortObject ( bottomTileObjectType ) || isShortObject ( correctedObjectType ) ) {
795
- _tilePassabilityDirections &= ~Direction::BOTTOM;
796
- }
797
- else {
798
- _tilePassabilityDirections = 0 ;
799
- return ;
800
- }
793
+ if ( ( bottomTile.getTileIndependentPassability () & Direction::TOP ) != 0 ) {
794
+ // This is an action object with unrestricted access from top.
795
+
796
+ // Only main action object parts can have unrestricted access.
797
+ assert ( MP2::isOffGameActionObject ( bottomTileObjectType ) );
798
+ return ;
799
+ }
800
+
801
+ if ( !isShortObject ( bottomTileObjectType ) && !isShortObject ( correctedObjectType ) ) {
802
+ // Since the object on the tile below is considered as tall we must mark this tile as impassable.
803
+ _tilePassabilityDirections = 0 ;
801
804
}
805
+
806
+ return ;
802
807
}
803
- else if ( isShortObject ( bottomTileObjectType )
808
+
809
+ if ( isShortObject ( bottomTileObjectType )
804
810
|| ( !bottomTile.containsAnyObjectIcnType ( getValidObjectIcnTypes () )
805
811
&& ( isCombinedObject ( objectType ) || isCombinedObject ( bottomTileObjectType ) ) ) ) {
806
- _tilePassabilityDirections &= ~Direction::BOTTOM;
812
+ // If this assertion blows up then the above checks are invalid!
813
+ assert ( ( bottomTile.getTileIndependentPassability () & Direction::TOP ) == 0 );
807
814
}
808
815
else {
809
816
_tilePassabilityDirections = 0 ;
810
- return ;
811
817
}
812
818
}
813
819
}
You can’t perform that action at this time.
0 commit comments