no_of_wizards counter can be incorrect after Wizard escapes
vultur-cadens opened this issue · comments
The fix for #1029 re-introduced #372.
The fix for #372 (12498ff) made it so that m_detach()
would call wizdead()
, and also made it so that the Wizard would not escape the dungeon if only one of him existed.
After the fix for #1029 (92a993a), wizdead()
is now only called if m_detach()
was called due to the Wizard being killed; wizdead()
is no longer called when he escapes.
If there are two Wizards of Yendor, you can make one of them flee the dungeon. no_of_wizards
will not be decremented, and you can either kill the remaining Wizard or let him flee the dungeon too. After this, he will not come back because no_of_wizards
is non-zero, but there is no Wizard in the dungeon.
Moving the wizdead()
call out of the due_to_death
conditional may solve this; another possibility is to simply prevent the Wizard from escaping the dungeon, regardless of how many of him there are.