src/gen-chunk.c
void chunk_validate_objects(struct chunk *c) {
	int x, y;
	struct object *obj;

	for (y = 0; y < c->height; y++) {
		for (x = 0; x < c->width; x++) {
			for (obj = square_object(c, y, x); obj; obj = obj->next)
				assert(obj->tval != 0);
			if (c->squares[y][x].mon > 0) {
				struct monster *mon = square_monster(c, y, x);
				if (mon->held_obj)
					for (obj = mon->held_obj; obj; obj = obj->next)
						assert(obj->tval != 0);
			}
		}
	}
}
/**
 * Validate that the chunk contains no NULL objects. 
 * Only checks for nonzero tval.
 * \param c is the chunk to validate.
 */
Validate that the chunk contains no NULL objects.
Only checks for nonzero tval.
\param c is the chunk to validate.
Validate that the chunk contains no NULL objects . Only checks for nonzero tval . \ param c is the chunk to validate .
void chunk_validate_objects(struct chunk *c) {
	int x, y;
	struct object *obj;
	for (y = 0; y < c->height; y++) {
		for (x = 0; x < c->width; x++) {
			for (obj = square_object(c, y, x); obj; obj = obj->next)
				assert(obj->tval != 0);
			if (c->squares[y][x].mon > 0) {
				struct monster *mon = square_monster(c, y, x);
				if (mon->held_obj)
					for (obj = mon->held_obj; obj; obj = obj->next)
						assert(obj->tval != 0);
			}
		}
	}
}
void chunk_validate_objects ( struct chunk * c ) { int x , y ; struct object * obj ; for ( y = 0 ; y < c -> height ; y ++ ) { for ( x = 0 ; x < c -> width ; x ++ ) { for ( obj = square_object ( c , y , x ) ; obj ; obj = obj -> next ) assert ( obj -> tval != 0 ) ; if ( c -> squares [ y ] [ x ] . mon > 0 ) { struct monster * mon = square_monster ( c , y , x ) ; if ( mon -> held_obj ) for ( obj = mon -> held_obj ; obj ; obj = obj -> next ) assert ( obj -> tval != 0 ) ; } } } }
Validate that the chunk contains no NULL objects.
Validate that the chunk contains no NULL objects .