changeset 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 796e2a10cd41
children 6b5fbd7c3ece
files arogue7/fight.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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;
 		}