Mercurial > hg > early-roguelike
diff xrogue/fight.c @ 140:856017d63519
xrogue: don't segfault when backstabbing while empty-handed.
The code for backstabbing checked the weapon's properties without
making sure it was not NULL.
author | John "Elwin" Edwards |
---|---|
date | Tue, 05 May 2015 12:12:20 -0400 |
parents | e6179860cb76 |
children | f54901b9c39b |
line wrap: on
line diff
--- a/xrogue/fight.c Tue May 05 12:07:12 2015 -0400 +++ b/xrogue/fight.c Tue May 05 12:12:20 2015 -0400 @@ -677,7 +677,8 @@ if (mult > 5) mult = 5; - if (weap->o_type == RELIC && weap->o_which == MUSTY_DAGGER) + if (weap && weap->o_type == RELIC && + weap->o_which == MUSTY_DAGGER) mult++; damage *= mult; }