MCPcopy Create free account
hub / github.com/crawl/crawl / _resolve_map

Function _resolve_map

crawl-ref/source/maps.cc:225–248  ·  view source on GitHub ↗

Resolve Lua and transformation directives, then mirror and rotate the map if allowed

Source from the content-addressed store, hash-verified

223// Resolve Lua and transformation directives, then mirror and rotate the
224// map if allowed
225static 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
250bool resolve_subvault(map_def &map)
251{

Callers 1

_write_vaultFunction · 0.85

Calls 7

_resolve_map_luaFunction · 0.85
coinflipFunction · 0.85
hmirrorMethod · 0.80
vmirrorMethod · 0.80
rotateMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected