Fix accessing freed landmine trap
Landmine blew up, scatter exploded a potion of oil, which melted the ice on which the landmine was, resulting in the landmine trap being deleted. The code then tried to access it to make a pit.
This commit is contained in:
+2
-1
@@ -3044,8 +3044,9 @@ blow_up_landmine(struct trap *trap)
|
|||||||
/* if under the portcullis, the bridge is adjacent */
|
/* if under the portcullis, the bridge is adjacent */
|
||||||
if (find_drawbridge(&dbx, &dby))
|
if (find_drawbridge(&dbx, &dby))
|
||||||
destroy_drawbridge(dbx, dby);
|
destroy_drawbridge(dbx, dby);
|
||||||
trap = t_at(x, y); /* expected to be null after destruction */
|
|
||||||
}
|
}
|
||||||
|
trap = t_at(x, y); /* expected to be null after destruction */
|
||||||
|
/* or could be null if scatter blew up oil which melted ice */
|
||||||
/* convert landmine into pit */
|
/* convert landmine into pit */
|
||||||
if (trap) {
|
if (trap) {
|
||||||
if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) {
|
if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user