Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 10, 2015, 11:33   #1
Tibarius
Swordsman
 
Join Date: Jun 2011
Location: Germany
Age: 48
Posts: 256
Tibarius is on a distinguished road
[3.5.1] bug in drop item

birth Setting "don't stack objects on the floor" is YES

BUG: An object you drop disappears even if there would be an empty space for it in a 3x3 grid around the Player Position.

reproduce bug by the following steps:
create new testchar, set birth Option don't stack Options to true
Buy 80 arrows and 10 flasks of oil and a 3rd item type in town, enter dungeon and leave dungeon until you find an empty room that is big enough to have a 7x7 grid in it.

You cover the floor with items (i.e. arrows) for a grid of 7x7 floor spaces (Player Position is in the Center of the grid). Now you take one arrow out (regardless where) and drop a 2nd item (i.e. flask of oil). The object Drops at the place where you picked up the arrow. Now you drop a 3rd object (i.e. iron shot or pebble) - it disappears.

That is the "normal" behavior which is correct. Now you fill the whole grid with 1 arrow at each Position and just take one arrow out, right beside the Center Position. You squelch arrows.

If you hit "K" and toggle ignore off/on you can check that there is a grid of arrows around you, with just one empty space right beside the Player Position in the Center of the grid.

You toggle ignore "on", it Looks like the whole room is empty (we just know that only one space is empty tho).

You drop a 2nd item type (i.e. flask of oil). The item disappears (bug!).
Instead of disappearing the object should have been dropped in the empty Position right beside the Player, because there IS an empy space within a 3x3 grid around the Player.
Tibarius is offline   Reply With Quote
Old January 12, 2015, 12:51   #2
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,966
PowerWyrm is on a distinguished road
In fact the object should have been dropped under the character. That's what happens in my variant.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old January 12, 2015, 13:31   #3
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,966
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://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old January 13, 2015, 09:27   #4
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,966
PowerWyrm is on a distinguished road
Ticket #1832 created.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Poll: Vanilla item quality drop rates fizzix Vanilla 21 November 23, 2012 03:36
BUG: Using non-existent item by number causes crash Max Stats Vanilla 10 February 28, 2011 00:37
Scroll of restore item - possible ID by use bug Taha Development 3 February 16, 2011 21:26
3.1.1 Home Drop Bug paboperfecto Vanilla 7 December 11, 2009 17:07
r1415 bug - Item generation Sirridan Vanilla 3 June 1, 2009 08:23


All times are GMT +1. The time now is 21:25.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.