… | |
… | |
93 | */ |
93 | */ |
94 | |
94 | |
95 | int surround_index = 0; |
95 | int surround_index = 0; |
96 | |
96 | |
97 | // don't forget to update the mapspace! |
97 | // don't forget to update the mapspace! |
98 | map->at (i - 1, j).update (); |
98 | if (i > 0) map->at (i - 1, j ).update (); |
99 | map->at (i + 1, j).update (); |
99 | if (i < RP->Xsize - 1) map->at (i + 1, j ).update (); |
100 | map->at (i , j - 1).update (); |
100 | if (j > 0) map->at (i , j - 1).update (); |
101 | map->at (i , j + 1).update (); |
101 | if (j < RP->Ysize - 1) map->at (i , j + 1).update (); |
102 | |
102 | |
103 | if ((i > 0) && (GET_MAP_MOVE_BLOCK (map, i - 1, j) & MOVE_WALK)) |
103 | if ((i > 0) && (GET_MAP_MOVE_BLOCK (map, i - 1, j) & MOVE_WALK)) |
104 | surround_index |= 1; |
104 | surround_index |= 1; |
105 | if ((i < RP->Xsize - 1) && (GET_MAP_MOVE_BLOCK (map, i + 1, j) & MOVE_WALK)) |
105 | if ((i < RP->Xsize - 1) && (GET_MAP_MOVE_BLOCK (map, i + 1, j) & MOVE_WALK)) |
106 | surround_index |= 2; |
106 | surround_index |= 2; |