Prevent explosions moving objects out of map
This commit is contained in:
@@ -840,7 +840,10 @@ scatter(coordxy sx, coordxy sy, /* location of objects to scatter */
|
||||
gt.thrownobj = stmp->obj; /* mainly in case it kills hero */
|
||||
gb.bhitpos.x = stmp->ox + stmp->dx;
|
||||
gb.bhitpos.y = stmp->oy + stmp->dy;
|
||||
typ = levl[gb.bhitpos.x][gb.bhitpos.y].typ;
|
||||
if (isok(gb.bhitpos.x, gb.bhitpos.y))
|
||||
typ = levl[gb.bhitpos.x][gb.bhitpos.y].typ;
|
||||
else
|
||||
typ = STONE;
|
||||
if (!isok(gb.bhitpos.x, gb.bhitpos.y)) {
|
||||
gb.bhitpos.x -= stmp->dx;
|
||||
gb.bhitpos.y -= stmp->dy;
|
||||
|
||||
Reference in New Issue
Block a user