@@ -683,22 +683,33 @@ std::pair<std::string, bool> cata_tiles::get_omt_id_rotation_and_subtile(
683
683
oter_type_id ot_type_id = ot.get_type_id ();
684
684
const oter_type_t &ot_type = *ot_type_id;
685
685
686
+ // get terrain neighborhood
687
+ const std::array<oter_type_id, 4 > neighborhood = {
688
+ oter_at ( omp + point_south )->get_type_id (),
689
+ oter_at ( omp + point_east )->get_type_id (),
690
+ oter_at ( omp + point_west )->get_type_id (),
691
+ oter_at ( omp + point_north )->get_type_id ()
692
+ };
693
+
686
694
if ( ot_type.has_connections () ) {
687
695
// This would be for connected terrain
696
+ char val = 0 ;
688
697
689
- // get terrain neighborhood
690
- const std::array<oter_type_id, 4 > neighborhood = {
691
- oter_at ( omp + point_south )->get_type_id (),
692
- oter_at ( omp + point_east )->get_type_id (),
693
- oter_at ( omp + point_west )->get_type_id (),
694
- oter_at ( omp + point_north )->get_type_id ()
695
- };
698
+ // populate connection information
699
+ for ( int i = 0 ; i < 4 ; ++i ) {
700
+ if ( ot_type.connects_to ( neighborhood[i] ) ) {
701
+ val += 1 << i;
702
+ }
703
+ }
696
704
705
+ get_rotation_and_subtile ( val, -1 , rota, subtile );
706
+ } else if ( ot_type.has_flag ( oter_flags::water ) ) {
707
+ // water looks nicer if it connects together
697
708
char val = 0 ;
698
709
699
710
// populate connection information
700
711
for ( int i = 0 ; i < 4 ; ++i ) {
701
- if ( ot_type. connects_to ( neighborhood[i] ) ) {
712
+ if ( neighborhood[i]-> has_flag ( oter_flags::water ) ) {
702
713
val += 1 << i;
703
714
}
704
715
}
0 commit comments