changeset 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 0d151573bdb0
children cc5148bdf345
files xrogue/fight.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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;
                 }