diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-09-17 21:07:27 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-09-17 21:07:27 +0000 |
commit | 32e2a57422134a424c96f93241fa5631b10ec328 (patch) | |
tree | 5fdd48dd2114c765d3fc6cb5fc9b63979c07b40b /games/hack/hack.zap.c | |
parent | e40020fecfffa4b5e4636db2b88fa308c53c1923 (diff) |
dothrow() calls bhit() w/ both null hit functions thus have to check before calling those; from Juha Erkkila <erkkila@cc.jyu.fi>; pr3923
Diffstat (limited to 'games/hack/hack.zap.c')
-rw-r--r-- | games/hack/hack.zap.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/games/hack/hack.zap.c b/games/hack/hack.zap.c index f3f4325be4e..1695734aa0d 100644 --- a/games/hack/hack.zap.c +++ b/games/hack/hack.zap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.zap.c,v 1.8 2003/05/19 09:00:54 pjanzen Exp $ */ +/* $OpenBSD: hack.zap.c,v 1.9 2004/09/17 21:07:26 mickey Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,7 +62,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: hack.zap.c,v 1.8 2003/05/19 09:00:54 pjanzen Exp $"; +static const char rcsid[] = "$OpenBSD: hack.zap.c,v 1.9 2004/09/17 21:07:26 mickey Exp $"; #endif /* not lint */ #include <stdlib.h> @@ -390,11 +390,12 @@ bhit(int ddx, int ddy, int range, char sym, tmp_at(-1, -1); /* close call */ return(mtmp); } - (*fhitm)(mtmp, obj); + if (fhitm) + (*fhitm)(mtmp, obj); range -= 3; } if ((otmp = o_at(bhitpos.x,bhitpos.y))){ - if((*fhito)(otmp, obj)) + if(fhito && (*fhito)(otmp, obj)) range--; } if (!ZAP_POS(typ)) { |