diff --git a/attack.cpp b/attack.cpp index 4db866e6..cf12a964 100644 --- a/attack.cpp +++ b/attack.cpp @@ -157,7 +157,8 @@ EX bool canAttack(cell *c1, eMonster m1, cell *c2, eMonster m2, flagtype flags) if(isWorm(m2) && m2 != moTentacleGhost && !isDragon(m2)) return false; // dragon can't attack itself, or player who mounted it - if(c1 && c2 && isWorm(c1->monst) && isWorm(c2->monst) && wormhead(c1) == wormhead(c2) + cell *cp = (flags & AF_BOW) ? cwt.at : c1; + if(cp && c2 && isWorm(cp->monst) && isWorm(c2->monst) && wormhead(cp) == wormhead(c2) && m1 != moTentacleGhost && m2 != moTentacleGhost) return false; diff --git a/crossbow.cpp b/crossbow.cpp index 71b0447d..561f454f 100644 --- a/crossbow.cpp +++ b/crossbow.cpp @@ -101,7 +101,7 @@ EX int create_path() { if(thruVine(cw2.at, cw2.peek())) continue; if(cw2.at->monst) { - flagtype attackflags = AF_NORMAL; + flagtype attackflags = AF_BOW; if(items[itOrbSpeed]&1) attackflags |= AF_FAST; if(items[itOrbSlaying]) attackflags |= AF_CRUSH; if(items[itCurseWeakness]) attackflags |= AF_WEAK; @@ -265,7 +265,7 @@ EX void add_fire(cell *c) { } EX void shoot() { - flagtype attackflags = AF_NORMAL; + flagtype attackflags = AF_BOW; if(items[itOrbSpeed]&1) attackflags |= AF_FAST; if(items[itOrbSlaying]) attackflags |= AF_CRUSH; if(items[itCurseWeakness]) attackflags |= AF_WEAK; diff --git a/hyper.h b/hyper.h index c8762983..62b60683 100644 --- a/hyper.h +++ b/hyper.h @@ -636,6 +636,7 @@ typedef function cellfunction; #define AF_PLAGUE Flag(32) // Orb of Plague (do not check adjacency) #define AF_PSI Flag(33) // Orb of the Mind #define AF_WEAK Flag(34) // Curse of Weakness +#define AF_BOW Flag(35) // crossbow attack #if CAP_SDL