Bug: Weaponspells and shields can misfire when occupants have fled
Danger: Medium - Weaponspells and defensive shielding spells do not account for the wimply flag.
Found by: Luc
Fixed by: Luc
if( ( retcode = damage( ch, victim, dam, dt ) ) != rNONE )
if( char_died( ch ) )
if( char_died( victim ) )
retcode = rNONE;
if( dam == 0 )
Below that, add:
/* damage() also handles wimpying out opponents, making them flee. Let's check
if they are still in the same room before handling shields and weapon spells. */
if ( ch->in_room != victim->in_room )
If an NPC or player with the wimply flag set has fled the room due to the amount of damage they've taken, the weaponspell and defensive shield spell code can still strike at them after they've left the room. This obviously should not happen since the occupant fled.