--- deliantra/server/common/los.C 2007/01/07 02:39:13 1.17 +++ deliantra/server/common/los.C 2007/01/15 01:39:42 1.18 @@ -396,6 +396,7 @@ { if (ax < 0 || ax >= op->contr->ns->mapx) continue; + for (ay = basey - light; ay <= basey + light; ay++) { if (ay < 0 || ay >= op->contr->ns->mapy) @@ -412,16 +413,15 @@ { x1 = abs (basex - ax) * abs (basex - ax); y1 = abs (basey - ay) * abs (basey - ay); - if (light > 0) - op->contr->blocked_los[ax][ay] -= MAX ((light - isqrt (x1 + y1)), 0); - if (light < 0) - op->contr->blocked_los[ax][ay] -= MIN ((light + isqrt (x1 + y1)), 0); + + if (light > 0) op->contr->blocked_los[ax][ay] -= max (light - isqrt (x1 + y1), 0); + if (light < 0) op->contr->blocked_los[ax][ay] -= min (light + isqrt (x1 + y1), 0); } - } /* for ay */ - } /* for ax */ - } /* if this space is providing light */ - } /* for y */ - } /* for x */ + } + } + } + } + } /* Outdoor should never really be completely pitch black dark like * a dungeon, so let the player at least see a little around themselves @@ -438,6 +438,7 @@ op->contr->blocked_los[x + op->contr->ns->mapx / 2][y + op->contr->ns->mapy / 2] = MAX_DARKNESS - 2; } } + /* grant some vision to the player, based on the darklevel */ for (x = darklevel - MAX_DARKNESS; x < MAX_DARKNESS + 1 - darklevel; x++) for (y = darklevel - MAX_DARKNESS; y < MAX_DARKNESS + 1 - darklevel; y++) @@ -451,7 +452,6 @@ * odd that you can see yourself (and what your standing on), but * really need for any reasonable game play. */ - static void blinded_sight (object *op) {