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.13 by root, Mon Dec 25 14:43:22 2006 UTC vs.
Revision 1.16 by pippijn, Sat Jan 6 14:42:29 2007 UTC

1/* 1/*
2 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
3 3
4 Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
4 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
5 Copyright (C) 1992 Frank Tore Johansen 6 Copyright (C) 1992 Frank Tore Johansen
6 7
7 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
293 op->contr->blocked_los[dx][dy] = -1; 294 op->contr->blocked_los[dx][dy] = -1;
294 } 295 }
295 } 296 }
296 } 297 }
297 298
298 if (MAP_DARKNESS (op->map) > 0) /* player is on a dark map */ 299 if (op->map->darkness > 0) /* player is on a dark map */
299 expand_lighted_sight (op); 300 expand_lighted_sight (op);
300 301
301 302
302 /* clear mark squares */ 303 /* clear mark squares */
303 for (x = 0; x < op->contr->ns->mapx; x++) 304 for (x = 0; x < op->contr->ns->mapx; x++)
330{ 331{
331 int x, y, darklevel, ax, ay, basex, basey, mflags, light, x1, y1; 332 int x, y, darklevel, ax, ay, basex, basey, mflags, light, x1, y1;
332 maptile *m = op->map; 333 maptile *m = op->map;
333 sint16 nx, ny; 334 sint16 nx, ny;
334 335
335 darklevel = MAP_DARKNESS (m); 336 darklevel = m->darkness;
336 337
337 /* If the player can see in the dark, lower the darklevel for him */ 338 /* If the player can see in the dark, lower the darklevel for him */
338 if (QUERY_FLAG (op, FLAG_SEE_IN_DARK)) 339 if (QUERY_FLAG (op, FLAG_SEE_IN_DARK))
339 darklevel -= 2; 340 darklevel -= 2;
340 341
349 /* Do a sanity check. If not valid, some code below may do odd 350 /* Do a sanity check. If not valid, some code below may do odd
350 * things. 351 * things.
351 */ 352 */
352 if (darklevel > MAX_DARKNESS) 353 if (darklevel > MAX_DARKNESS)
353 { 354 {
354 LOG (llevError, "Map darkness for %s on %s is too high (%d)\n", &op->name, op->map->path, darklevel); 355 LOG (llevError, "Map darkness for %s on %s is too high (%d)\n", &op->name, &op->map->path, darklevel);
355 darklevel = MAX_DARKNESS; 356 darklevel = MAX_DARKNESS;
356 } 357 }
357 358
358 /* First, limit player furthest (unlighted) vision */ 359 /* First, limit player furthest (unlighted) vision */
359 for (x = 0; x < op->contr->ns->mapx; x++) 360 for (x = 0; x < op->contr->ns->mapx; x++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines