ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/los.C
(Generate patch)

Comparing deliantra/server/common/los.C (file contents):
Revision 1.20 by root, Mon Jan 29 16:11:48 2007 UTC vs.
Revision 1.23 by root, Fri Feb 16 22:21:45 2007 UTC

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// 31/32 == a speed hack
47// we would like to use 32 for speed, but the code loops endlessly
48// then, reason not yet identified, so only make the array use 32,
49// not the define's.
46blocks block[MAP_CLIENT_X][MAP_CLIENT_Y]; 50blocks block[MAP_CLIENT_X][MAP_CLIENT_Y == 31 ? 32 : MAP_CLIENT_Y];
47 51
48static void expand_lighted_sight (object *op); 52static void expand_lighted_sight (object *op);
49 53
50/* 54/*
51 * Used to initialise the array used by the LOS routines. 55 * Used to initialise the array used by the LOS routines.
490 if (QUERY_FLAG (op, FLAG_BLIND)) /* player is blind */ 494 if (QUERY_FLAG (op, FLAG_BLIND)) /* player is blind */
491 blinded_sight (op); 495 blinded_sight (op);
492 else 496 else
493 expand_sight (op); 497 expand_sight (op);
494 498
499 //TODO: no range-checking whatsoever :(
495 if (QUERY_FLAG (op, FLAG_XRAYS)) 500 if (QUERY_FLAG (op, FLAG_XRAYS))
496 {
497 int x, y;
498
499 for (x = -2; x <= 2; x++) 501 for (int x = -2; x <= 2; x++)
500 for (y = -2; y <= 2; y++) 502 for (int y = -2; y <= 2; y++)
501 op->contr->blocked_los[dx + x][dy + y] = 0; 503 op->contr->blocked_los[dx + x][dy + y] = 0;
502 }
503} 504}
504 505
505/* update all_map_los is like update_all_los below, 506/* update all_map_los is like update_all_los below,
506 * but updates everyone on the map, no matter where they 507 * but updates everyone on the map, no matter where they
507 * are. This generally should not be used, as a per 508 * are. This generally should not be used, as a per

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines