From fb870fdb4e49d23037a8fbaf47677dfe353e1c6b Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Tue, 5 May 2015 12:12:20 -0400 Subject: [PATCH] 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. --- xrogue/fight.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xrogue/fight.c b/xrogue/fight.c index 80ffe77..8ddbba7 100644 --- a/xrogue/fight.c +++ b/xrogue/fight.c @@ -677,7 +677,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; }