Fix ball and chain sanity

Scatter did not consider the ball or chain, and moved them around, causing
ball and chain sanity error.

One way to trigger was being punished, with chain on a land mine and having
a monster trigger the mine. Now the chain will shatter, unpunishing the hero.
This commit is contained in:
Pasi Kallinen
2019-10-08 19:44:51 +03:00
parent 2172c5e7ff
commit e92445810f
2 changed files with 8 additions and 0 deletions

View File

@@ -621,6 +621,13 @@ struct obj *obj; /* only scatter this obj */
obj->ox, obj->oy, sx, sy);
while ((otmp = (individual_object ? obj : level.objects[sx][sy])) != 0) {
if (otmp == uball || otmp == uchain) {
boolean waschain = (otmp == uchain);
pline_The("chain shatters!");
unpunish();
if (waschain)
continue;
}
if (otmp->quan > 1L) {
qtmp = otmp->quan - 1L;
if (qtmp > LARGEST_INT)