From: cohrs Date: Mon, 9 Dec 2002 02:07:29 +0000 (+0000) Subject: bouncing zaps X-Git-Tag: MOVE2GIT~2315 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f50893e136d75a4cedeb3a5f82f65d24c2fc0f5;p=nethack bouncing zaps As From a bug report, don't let bounces go past the edge of closed doors. His suggested patch included some redundancy, which I've removed. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 06fbb4c5a..2f7f513d0 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -319,6 +319,7 @@ various missing or inappropriate "killed by" death messages second attack for two-weapon combat will miss if first knocks target away jousting effect no longer occurs every time riding character hits with lance skeletons should be able to wear the armor they're created with +bouncing zaps should not bounce around the edge of closed doors Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 5f7dfc665..427cecf02 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3441,10 +3441,12 @@ register int dx,dy; dy = -dy; } else { if(isok(sx,lsy) && ZAP_POS(rmn = levl[sx][lsy].typ) && + !closed_door(sx,lsy) && (IS_ROOM(rmn) || (isok(sx+dx,lsy) && ZAP_POS(levl[sx+dx][lsy].typ)))) bounce = 1; if(isok(lsx,sy) && ZAP_POS(rmn = levl[lsx][sy].typ) && + !closed_door(lsx,sy) && (IS_ROOM(rmn) || (isok(lsx,sy+dy) && ZAP_POS(levl[lsx][sy+dy].typ)))) if(!bounce || rn2(2))