… | |
… | |
3539 | pl->ranges[i] = 0; |
3539 | pl->ranges[i] = 0; |
3540 | if (pl->shoottype == i) |
3540 | if (pl->shoottype == i) |
3541 | pl->shoottype = range_none; |
3541 | pl->shoottype = range_none; |
3542 | } |
3542 | } |
3543 | } |
3543 | } |
|
|
3544 | |
|
|
3545 | sint8 |
|
|
3546 | player::visibility_at (maptile *map, int x, int y) const |
|
|
3547 | { |
|
|
3548 | if (!ns) |
|
|
3549 | return 0; |
|
|
3550 | |
|
|
3551 | int dx, dy; |
|
|
3552 | if (!adjacent_map (map, ns->current_map, &dx, &dy)) |
|
|
3553 | return 0; |
|
|
3554 | |
|
|
3555 | x += dx - ns->current_x + ns->mapx / 2; |
|
|
3556 | y += dy - ns->current_y + ns->mapy / 2; |
|
|
3557 | |
|
|
3558 | if (!IN_RANGE_EXC (x, 0, ns->mapx) || !IN_RANGE_EXC (y, 0, ns->mapy)) |
|
|
3559 | return 0; |
|
|
3560 | |
|
|
3561 | return 100 - blocked_los [x][y]; |
|
|
3562 | } |