… | |
… | |
293 | op->contr->blocked_los[dx][dy] = -1; |
293 | op->contr->blocked_los[dx][dy] = -1; |
294 | } |
294 | } |
295 | } |
295 | } |
296 | } |
296 | } |
297 | |
297 | |
298 | if (MAP_DARKNESS (op->map) > 0) /* player is on a dark map */ |
298 | if (op->map->darkness > 0) /* player is on a dark map */ |
299 | expand_lighted_sight (op); |
299 | expand_lighted_sight (op); |
300 | |
300 | |
301 | |
301 | |
302 | /* clear mark squares */ |
302 | /* clear mark squares */ |
303 | for (x = 0; x < op->contr->ns->mapx; x++) |
303 | for (x = 0; x < op->contr->ns->mapx; x++) |
… | |
… | |
330 | { |
330 | { |
331 | int x, y, darklevel, ax, ay, basex, basey, mflags, light, x1, y1; |
331 | int x, y, darklevel, ax, ay, basex, basey, mflags, light, x1, y1; |
332 | maptile *m = op->map; |
332 | maptile *m = op->map; |
333 | sint16 nx, ny; |
333 | sint16 nx, ny; |
334 | |
334 | |
335 | darklevel = MAP_DARKNESS (m); |
335 | darklevel = m->darkness; |
336 | |
336 | |
337 | /* If the player can see in the dark, lower the darklevel for him */ |
337 | /* If the player can see in the dark, lower the darklevel for him */ |
338 | if (QUERY_FLAG (op, FLAG_SEE_IN_DARK)) |
338 | if (QUERY_FLAG (op, FLAG_SEE_IN_DARK)) |
339 | darklevel -= 2; |
339 | darklevel -= 2; |
340 | |
340 | |
… | |
… | |
349 | /* Do a sanity check. If not valid, some code below may do odd |
349 | /* Do a sanity check. If not valid, some code below may do odd |
350 | * things. |
350 | * things. |
351 | */ |
351 | */ |
352 | if (darklevel > MAX_DARKNESS) |
352 | if (darklevel > MAX_DARKNESS) |
353 | { |
353 | { |
354 | LOG (llevError, "Map darkness for %s on %s is too high (%d)\n", &op->name, op->map->path, darklevel); |
354 | LOG (llevError, "Map darkness for %s on %s is too high (%d)\n", &op->name, &op->map->path, darklevel); |
355 | darklevel = MAX_DARKNESS; |
355 | darklevel = MAX_DARKNESS; |
356 | } |
356 | } |
357 | |
357 | |
358 | /* First, limit player furthest (unlighted) vision */ |
358 | /* First, limit player furthest (unlighted) vision */ |
359 | for (x = 0; x < op->contr->ns->mapx; x++) |
359 | for (x = 0; x < op->contr->ns->mapx; x++) |