--- deliantra/server/server/spell_attack.C 2007/01/15 21:06:20 1.28 +++ deliantra/server/server/spell_attack.C 2007/01/29 16:11:48 1.29 @@ -1485,7 +1485,6 @@ } - /********************************************************************** * mood change * Arguably, this may or may not be an attack spell. But since it @@ -1524,11 +1523,9 @@ else race = spell->race; - for (x = op->x - range; x <= op->x + range; x++) for (y = op->y - range; y <= op->y + range; y++) { - done_one = 0; m = op->map; nx = x; @@ -1541,7 +1538,12 @@ if (!(mflags & P_IS_ALIVE)) continue; - for (tmp = GET_MAP_OB (m, nx, ny); tmp; tmp = tmp->above) + // players can only affect spaces that they can actually see + if (caster && caster->contr + && caster->contr->visibility_at (m, nx, ny) < 70) + continue; + + for (tmp = GET_MAP_TOP (m, nx, ny); tmp; tmp = tmp->below) if (QUERY_FLAG (tmp, FLAG_MONSTER)) break; @@ -1558,6 +1560,7 @@ /* Make sure the race is OK. Likewise, only effect undead if spell specifically allows it */ if (race && head->race && !strstr (race, head->race)) continue; + if (QUERY_FLAG (head, FLAG_UNDEAD) && !QUERY_FLAG (spell, FLAG_UNDEAD)) continue; @@ -1604,7 +1607,7 @@ continue; } - /* Done with saving throw. Now start effecting the monster */ + /* Done with saving throw. Now start affecting the monster */ /* aggravation */ if (QUERY_FLAG (spell, FLAG_MONSTER))