Resolve Lua and transformation directives, then mirror and rotate the map if allowed
| 223 | // Resolve Lua and transformation directives, then mirror and rotate the |
| 224 | // map if allowed |
| 225 | static bool _resolve_map(map_def &map) |
| 226 | { |
| 227 | if (!_resolve_map_lua(map)) |
| 228 | return false; |
| 229 | |
| 230 | // Don't bother flipping or rotating 1x1 subvaults. |
| 231 | // This just cuts down on level generation message spam. |
| 232 | if (map.map.width() == map.map.height() && map.map.width() == 1) |
| 233 | return true; |
| 234 | |
| 235 | // Mirroring is possible for any map that does not explicitly forbid it. |
| 236 | // Note that mirroring also flips the orientation. |
| 237 | if (coinflip()) |
| 238 | map.hmirror(); |
| 239 | |
| 240 | if (coinflip()) |
| 241 | map.vmirror(); |
| 242 | |
| 243 | // The map may also refuse to be rotated. |
| 244 | if (coinflip()) |
| 245 | map.rotate(coinflip()); |
| 246 | |
| 247 | return true; |
| 248 | } |
| 249 | |
| 250 | bool resolve_subvault(map_def &map) |
| 251 | { |
no test coverage detected