Go Back   Angband Forums > Angband > Development

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old April 3, 2016, 11:59   #1
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
Crash due to referencing object deleted by drop_near()

Rather than clutter the Vanilla board, I'll discuss my findings here. Original thread is here

In summary, there is a repeatable crash if a monster picks up an object and that object is destroyed when the monster dies due to lack of floor space. The 'birth_stacking' flag seems to be ignored (the save file in the referenced thread has stacking on'.

In obj-pile.c in drop_near() there are a couple of chunks of code like this:

		/* Message */
		msg("The %s %s.", o_name,
			VERB_AGREEMENT(dropped->number, "disappears", "disappear"));

		/* Debug */
		if (player->wizard) msg("Breakage (no floor space).");

		/* Failure */
		if (dropped->known) {
			delist_object(cave_k, dropped->known);
		delist_object(c, dropped);
and in delist_object() we have:

	/* Don't delist an actual object if it still has a listed known object */
	if ((c == cave) && cave_k->objects[obj->oidx]) return;

	c->objects[obj->oidx] = NULL;
	obj->oidx = 0;
I'm thinking that when an object is picked up by a monster, it's not being removed from the 'cave' completely.

In mon_move.c in process_monster_grab_objects(), the code which performs the pick-up is

square_excise_object(c, ny, nx, obj);
monster_carry(c, mon, obj);
square_note_spot(c, ny, nx);
square_light_spot(c, ny, nx);
square_excise_object() just calls pile_excise() - but nowhere does the code seem to touch cave_k->objects[obj->oidx]

Hopefully this helps track down this nasty
calris is offline   Reply With Quote

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
borg out of sync sometimes due to lag in update on p_ptr->inventory[] APWhite Development 1 September 10, 2011 21:39
Ridiculous death due, in my opinion, to flawed design. Vogrim Vanilla 168 January 4, 2011 22:46
Amazing character but still YASD due to NAsTY monster Thraalbee AAR 12 September 11, 2010 09:13
object list fyonn Vanilla 17 June 23, 2010 16:04
28 tickets due by May 31. PaulBlay Development 0 May 5, 2009 21:26

All times are GMT +1. The time now is 01:56.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.