From 3bcf8ac2c157f78aee38d15c6245e8ee67c995ec Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Tue, 12 May 2015 18:57:30 -0400 Subject: [PATCH] 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. --- arogue7/fight.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arogue7/fight.c b/arogue7/fight.c index f487ca8..d053c7a 100644 --- a/arogue7/fight.c +++ b/arogue7/fight.c @@ -638,7 +638,8 @@ bool back_stab; 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; }