Decouple mon state adjustment from find_roll_to_hit

If you have a function named like that, and it goes and
changes the monster state, that's just wrong.

Move waking up the monster from the hit into separate function.
This commit is contained in:
Pasi Kallinen
2021-12-15 22:11:19 +02:00
parent 4d42823fd8
commit e251bb6a82
3 changed files with 30 additions and 11 deletions

View File

@@ -178,6 +178,7 @@ kick_monster(struct monst *mon, xchar x, xchar y)
attknum = 0,
tmp = find_roll_to_hit(mon, AT_KICK, (struct obj *) 0, &attknum,
&armorpenalty);
mon_maybe_wakeup_on_hit(mon);
for (i = 0; i < NATTK; i++) {
/* first of two kicks might have provoked counterattack