Kurt Fitzner wrote: > I noticed, since my characters normally pick Valriel, that blinding didn't > tend to do much. I've traced the issue down to a problem with operator > presedence. Either my compiler doesn't do it right, or there was a subtle bug > in the program. The following code is from monster.c check_wakeup() > > if (rv->distance < QUERY_FLAG(enemy, FLAG_STEALTH)?(radius/2)+1:radius) { > CLEAR_FLAG(op,FLAG_SLEEP); > return 1; > } Yeah - that looks bad. should have parens just to make it clearer to read the statement. No harm in putting them in - i'll check in a change for this shortly. > Also, the code for blinding is set up so that it checks if the monster is > blind, but also if the monster can't see in the dark. IF the monster can see > in the dark, then apparently blinding has no effect. I'd suggest changing > this. Elf and Dwarf players can see in the dark, but don't have blinding > protection. If anything, seeing in the dark would make you more succeptable > to blinding. My real issue, though, is that if you want to protect a monster > from blinding, making it see in the dark isn't the way to do it. The way to > do it is resist_blind 100 in the archtype. This would be for monsters that > don't depend on actual sight but, for example, smell. There are a lot of see > in the dark monsters for whom it is not appropriate for them to be immune to > blinding. I don't see anything in the attack code like what you describe, so presumably you are talking the bit in monster.c that looks sort of like: if ( QUERY_FLAG(op, FLAG_SLEEP) || QUERY_FLAG(op, FLAG_BLIND) || ((op->map->darkness>0) && !QUERY_FLAG(op,FLAG_SEE_IN_DARK) && !QUERY_FLAG(op,FLAG_SEE_INVISIBLE))) { if(!check_wakeup(op,enemy,&rv)) return 0; } (I've added some whitespace to it to make it more readable. since the BLIND check is part the the OR checks, if the creature is blind, it will always make a call to check_wakeup(). The check for see in dark will only happen if the player isn't blind or asleep. IF this is not what your talking about, I'd need some more specific area of the code you are talking about.