Skip to content

Commit 284549c

Browse files
committed
Fix: zombie_maker and hero or monster race
zombie_maker wasn't checking mplayer/monster race, and the attempt to check the hero's race was inappropriately applying the hero's draugr race to all non-zombie monsters. This ends up turning it into just a wrapper for the racial_zombie macro, but I left it as a function in case there needs to be more complex logic or special exceptions introduced in there in the future.
1 parent 1b2138d commit 284549c

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

include/extern.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ E int FDECL(cmap_to_type, (int));
15271527

15281528
E void NDECL(mon_sanity_check);
15291529
E int FDECL(m_poisongas_ok, (struct monst *));
1530-
E boolean FDECL(zombie_maker, (struct permonst *));
1530+
E boolean FDECL(zombie_maker, (struct monst *));
15311531
E int FDECL(zombie_form, (struct permonst *));
15321532
E void FDECL(become_flayer, (struct monst *));
15331533
E int FDECL(undead_to_corpse, (int));

src/end.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ int how;
640640
u.ugrave_arise = PM_WRAITH;
641641
else if (mptr->mlet == S_MUMMY && urace.mummynum != NON_PM)
642642
u.ugrave_arise = urace.mummynum;
643-
else if (zombie_maker(mptr) && urace.zombienum != NON_PM)
643+
else if (zombie_maker(mtmp) && urace.zombienum != NON_PM)
644644
u.ugrave_arise = urace.zombienum;
645645
/* Vampire Mages can produce more of their kind if
646646
conditions are just right */

src/mhitm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2723,7 +2723,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */
27232723
mdef->mhp = 0;
27242724
}
27252725

2726-
zombify = !mwep && zombie_maker(r_data(magr))
2726+
zombify = !mwep && zombie_maker(magr)
27272727
&& can_become_zombie(r_data(mdef))
27282728
&& ((mattk->aatyp == AT_TUCH
27292729
|| mattk->aatyp == AT_CLAW

src/mon.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,13 @@ struct monst *mtmp;
230230
/* Return TRUE if this monster is capable of converting other monsters into
231231
* zombies. */
232232
boolean
233-
zombie_maker(pm)
234-
struct permonst * pm;
233+
zombie_maker(mon)
234+
struct monst *mon;
235235
{
236-
switch(pm->mlet) {
237-
case S_ZOMBIE:
238-
/* Z-class monsters that aren't actually zombies go here */
239-
return is_zombie(pm);
240-
}
241-
242-
if (!Upolyd && Race_if(PM_DRAUGR))
243-
return TRUE;
244-
245-
return FALSE;
236+
/* NB: right now, this is literally just a wrapper around racial_zombie,
237+
* but maybe in the future there will be more complicated rules or
238+
* exceptions about when zombies will be created -- esp. by the hero */
239+
return racial_zombie(mon);
246240
}
247241

248242
/* From xNetHack: return the monster index of the zombie monster which this monster could be
@@ -4189,7 +4183,7 @@ int xkill_flags; /* XKILL_GIVEMSG, XKILL_NOMSG, XKILL_NOCORPSE,
41894183
* can figure it out here */
41904184
if (!indirect) {
41914185
zombify = (!thrownobj && !stoned && !uwep
4192-
&& zombie_maker(youmonst.data)
4186+
&& zombie_maker(&youmonst)
41934187
&& zombie_form(r_data(mtmp)) != NON_PM);
41944188
}
41954189
cadaver = make_corpse(mtmp, burycorpse ? CORPSTAT_BURIED

0 commit comments

Comments
 (0)