Ticket #814: afraid-turn-invisible.patch

File afraid-turn-invisible.patch, 539 bytes (added by rhinocesaurus, 10 years ago)

Sorry about that, apparently I forgot to test my first patch with something invisible. This seems to do the trick. Now you only lose a turn when there's an invisible monster (because that gives you information), and you definitely shouldn't be able to attack anything anymore while afraid.

  • src/attack.c

     
    300300        /* Track a new monster */ 
    301301        if (m_ptr->ml) health_track(cave_m_idx[y][x]); 
    302302 
     303        /* Handle player fear; this should only matter for invisible monsters */ 
     304        if(p_ptr->state.afraid) 
     305        { 
     306                /* Message */ 
     307                message_format(MSG_AFRAID, 0, "You are too afraid to attack %s!", m_name); 
    303308 
     309                /* Done */ 
     310                return; 
     311        } 
     312 
    304313        /* Disturb the monster */ 
    305314        wake_monster(m_ptr); 
    306315