… | |
… | |
3020 | |
3020 | |
3021 | if (!ob || !ob->map) |
3021 | if (!ob || !ob->map) |
3022 | return 0; |
3022 | return 0; |
3023 | |
3023 | |
3024 | /* so, on normal lighted maps, its hard to hide */ |
3024 | /* so, on normal lighted maps, its hard to hide */ |
3025 | level = ob->map->darkness - 2; |
3025 | level = ob->map->darklevel () - 2; |
3026 | |
3026 | |
3027 | /* this also picks up whether the object is glowing. |
3027 | /* this also picks up whether the object is glowing. |
3028 | * If you carry a light on a non-dark map, its not |
3028 | * If you carry a light on a non-dark map, its not |
3029 | * as bad as carrying a light on a pitch dark map */ |
3029 | * as bad as carrying a light on a pitch dark map */ |
3030 | if (has_carried_lights (ob)) |
3030 | if (has_carried_lights (ob)) |
3031 | level = -(10 + (2 * ob->map->darkness)); |
3031 | level = -(10 + (2 * ob->map->darklevel ())); |
3032 | |
3032 | |
3033 | /* scan through all nearby squares for terrain to hide in */ |
3033 | /* scan through all nearby squares for terrain to hide in */ |
3034 | for (i = 0, x = ob->x, y = ob->y; |
3034 | for (i = 0, x = ob->x, y = ob->y; |
3035 | i <= SIZEOFFREE1; |
3035 | i <= SIZEOFFREE1; |
3036 | i++, x = ob->x + freearr_x[i], y = ob->y + freearr_y[i]) |
3036 | i++, x = ob->x + freearr_x[i], y = ob->y + freearr_y[i]) |