Thread: Angband 4.2.3
View Single Post
Old September 20, 2021, 10:36   #88
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,901
PowerWyrm is on a distinguished road
There's a potential crash when digging rubble:

Code:
/* Create a simple object */
				place_object(cave, grid, player->depth, false, false,
							 ORIGIN_RUBBLE, 0);

				/* Observe the new object */
				if (!ignore_item_ok(player,
						square_object(cave, grid))
						&& square_isseen(cave, grid)) {
					msg("You have found something!");
				}
The place_object() function is not 100% guaranteed to generate an object at that location, which would produce a NULL pointer in square_object() on the line after.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote