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.52 by root, Fri Dec 26 10:36:42 2008 UTC vs.
Revision 1.53 by root, Sat Dec 27 02:31:18 2008 UTC

502 * map is the map that changed, x and y are the coordinates. 502 * map is the map that changed, x and y are the coordinates.
503 */ 503 */
504void 504void
505update_all_los (const maptile *map, int x, int y) 505update_all_los (const maptile *map, int x, int y)
506{ 506{
507 // no need to do anything if we don't have darkness
508 if (map->darklevel () <= 0)
509 return;
510
507 map->at (x, y).invalidate (); 511 map->at (x, y).invalidate ();
508 512
509 for_all_players (pl) 513 for_all_players (pl)
510 { 514 {
511 /* Player should not have a null map, but do this 515 /* Player should not have a null map, but do this
522 * player can't be on another map that may be closer, 526 * player can't be on another map that may be closer,
523 * so by setting it up this way, we trim processing 527 * so by setting it up this way, we trim processing
524 * some. 528 * some.
525 */ 529 */
526 if (pl->ob->map == map) 530 if (pl->ob->map == map)
527 {
528 if ((abs (pl->ob->x - x) <= pl->ns->mapx / 2) && (abs (pl->ob->y - y) <= pl->ns->mapy / 2)) 531 if ((abs (pl->ob->x - x) <= pl->ns->mapx / 2) && (abs (pl->ob->y - y) <= pl->ns->mapy / 2))
529 pl->do_los = 1; 532 pl->do_los = 1;
530 }
531 533
532 /* Now we check to see if player is on adjacent 534 /* Now we check to see if player is on adjacent
533 * maps to the one that changed and also within 535 * maps to the one that changed and also within
534 * view. The tile_maps[] could be null, but in that 536 * view. The tile_maps[] could be null, but in that
535 * case it should never match the pl->ob->map, so 537 * case it should never match the pl->ob->map, so

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines