Skip to content

Commit

Permalink
Angering monsters hit by items from exploding bag of holding
Browse files Browse the repository at this point in the history
  • Loading branch information
paxed committed Apr 8, 2023
1 parent 3296fc7 commit ce1f478
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mthrowu.c
Expand Up @@ -313,7 +313,9 @@ monshoot(struct monst* mtmp, struct obj* otmp, struct obj* mwep)
}

/* an object launched by someone/thing other than player attacks a monster;
return 1 if the object has stopped moving (hit or its range used up) */
return 1 if the object has stopped moving (hit or its range used up)
can anger the monster, if this happened due to hero (eg. exploding
bag of holding throwing the items) */
int
ohitmon(
struct monst *mtmp, /* accidental target, located at <gb.bhitpos.x,.y> */
Expand Down Expand Up @@ -485,6 +487,9 @@ ohitmon(
mtmp->mblinded = tmp;
}

if (!DEADMONSTER(mtmp) && !gc.context.mon_moving)
setmangry(mtmp, TRUE);

objgone = drop_throw(otmp, 1, gb.bhitpos.x, gb.bhitpos.y);
if (!objgone && range == -1) { /* special case */
obj_extract_self(otmp); /* free it for motion again */
Expand Down

0 comments on commit ce1f478

Please sign in to comment.