* Anything that might reveal Hell or trigger gemstone pillar events is unsafe. */
| 60 | * Anything that might reveal Hell or trigger gemstone pillar events is unsafe. |
| 61 | */ |
| 62 | bool isSafe(df::coord c) { |
| 63 | // convert to block coordinates |
| 64 | c.x >>= 4; |
| 65 | c.y >>= 4; |
| 66 | |
| 67 | // Don't reveal blocks that contain trigger events |
| 68 | if (trigger_cache.contains(c)) |
| 69 | return false; |
| 70 | |
| 71 | t_feature local_feature; |
| 72 | t_feature global_feature; |
| 73 | // get features of block |
| 74 | // error -> obviously not safe to manipulate |
| 75 | if(!Maps::ReadFeatures(c.x, c.y, c.z, &local_feature, &global_feature)) |
| 76 | return false; |
| 77 | |
| 78 | // Adamantine tubes and temples lead to Hell |
| 79 | if (local_feature.type == df::feature_type::deep_special_tube || |
| 80 | local_feature.type == df::feature_type::deep_surface_portal) |
| 81 | return false; |
| 82 | // And Hell *is* Hell. |
| 83 | if (global_feature.type == df::feature_type::underworld_from_layer) |
| 84 | return false; |
| 85 | // otherwise it's safe. |
| 86 | return true; |
| 87 | } |
| 88 | |
| 89 | static void update_minimap() { |
| 90 | game->minimap.update = 1; |
no test coverage detected