water vs acid
Fix the bug From a bug report.alt.org server, where killing a monster by closing the castle drawbridge resulted in a panic after the dead monster's possessions were dropped into the moat and a potion of acid exploded in the process. water_damage() deleted the object but had no way to tell flooreffects() that it was gone, so flooreffects() couldn't tell its own caller not to place and stack the object. After that, a chunk of freed memory became part of the floor objects chain and eventually triggered a panic which tried to make a save file but whose reason didn't get logged properly.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)fountain.c 3.5 2005/06/22 */
|
||||
/* SCCS Id: @(#)fountain.c 3.5 2006/05/08 */
|
||||
/* Copyright Scott R. Turner, srt@ucla, 10/27/86 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -125,7 +125,7 @@ genericptr_t poolcnt;
|
||||
levl[x][y].typ = POOL;
|
||||
/* No kelp! */
|
||||
del_engr_at(x, y);
|
||||
water_damage(level.objects[x][y], FALSE, TRUE);
|
||||
water_damage(&level.objects[x][y], FALSE, TRUE);
|
||||
|
||||
if ((mtmp = m_at(x, y)) != 0)
|
||||
(void) minliquid(mtmp);
|
||||
|
||||
Reference in New Issue
Block a user