View Single Post
Old January 12, 2015, 13:31   #3
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,773
PowerWyrm is on a distinguished road
The drop_near() function indeed retrieves the position of the character as a valid drop point. The floor_carry() function discards that location because it doesn't take into account squelched items. That's why the dropped item disappears.

In my variant, there is currently no birth_no_stacking option, but the MAX_FLOOR_STACK value is currently set to 1, which is completely equivalent. The code should make the same assumption.

So instead of:

Code:
	/* Option -- disallow stacking */
	if (OPT(birth_no_stacking) && n) return (0);

	/* The stack is already too large */
	if (n >= MAX_FLOOR_STACK)
	{
		/* Squelch the oldest squelched object */
		s16b squelch_idx = floor_get_idx_oldest_squelched(y, x);

		if (squelch_idx)
			delete_object_idx(squelch_idx);
		else
			return 0;
	}
the code should be:

Code:
	/* The stack is already too large */
	if ((n >= MAX_FLOOR_STACK) || (OPT(birth_no_stacking) && n))
	{
		/* Squelch the oldest squelched object */
		s16b squelch_idx = floor_get_idx_oldest_squelched(y, x);

		if (squelch_idx)
			delete_object_idx(squelch_idx);
		else
			return 0;
	}
__________________
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