Mercurial > hg > early-roguelike
diff arogue7/fight.c @ 132:66b0263af424
arogue7: prevent segfaults when backstabbing while empty-handed.
The calculation of the backstabbing multiplier checked the current
weapon's properties without making sure the current weapon pointer was
not NULL.
author | John "Elwin" Edwards |
---|---|
date | Tue, 12 May 2015 18:57:30 -0400 |
parents | b786053d2f37 |
children | 1cd604c827a3 |
line wrap: on
line diff
--- a/arogue7/fight.c Tue May 12 10:28:05 2015 -0400 +++ b/arogue7/fight.c Tue May 12 18:57:30 2015 -0400 @@ -638,7 +638,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; }