… | |
… | |
41 | { |
41 | { |
42 | int x[4], y[4]; |
42 | int x[4], y[4]; |
43 | int index; |
43 | int index; |
44 | } blocks; |
44 | } blocks; |
45 | |
45 | |
46 | blocks block[MAP_CLIENT_X][MAP_CLIENT_Y]; |
46 | blocks block[(MAP_CLIENT_X | 1) + 1][(MAP_CLIENT_Y | 1) + 1]; // still a speed hack |
47 | |
47 | |
48 | static void expand_lighted_sight (object *op); |
48 | static void expand_lighted_sight (object *op); |
49 | |
49 | |
50 | /* |
50 | /* |
51 | * Used to initialise the array used by the LOS routines. |
51 | * Used to initialise the array used by the LOS routines. |
… | |
… | |
490 | if (QUERY_FLAG (op, FLAG_BLIND)) /* player is blind */ |
490 | if (QUERY_FLAG (op, FLAG_BLIND)) /* player is blind */ |
491 | blinded_sight (op); |
491 | blinded_sight (op); |
492 | else |
492 | else |
493 | expand_sight (op); |
493 | expand_sight (op); |
494 | |
494 | |
|
|
495 | //TODO: no range-checking whatsoever :( |
495 | if (QUERY_FLAG (op, FLAG_XRAYS)) |
496 | if (QUERY_FLAG (op, FLAG_XRAYS)) |
496 | { |
|
|
497 | int x, y; |
|
|
498 | |
|
|
499 | for (x = -2; x <= 2; x++) |
497 | for (int x = -2; x <= 2; x++) |
500 | for (y = -2; y <= 2; y++) |
498 | for (int y = -2; y <= 2; y++) |
501 | op->contr->blocked_los[dx + x][dy + y] = 0; |
499 | op->contr->blocked_los[dx + x][dy + y] = 0; |
502 | } |
|
|
503 | } |
500 | } |
504 | |
501 | |
505 | /* update all_map_los is like update_all_los below, |
502 | /* update all_map_los is like update_all_los below, |
506 | * but updates everyone on the map, no matter where they |
503 | * but updates everyone on the map, no matter where they |
507 | * are. This generally should not be used, as a per |
504 | * are. This generally should not be used, as a per |