Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002083Core InformListspublic2018-12-13 00:122018-12-16 15:59
ReporterEleas 
Assigned To 
PrioritynormalSeveritycosmeticReproducibilityalways
StatusnewResolutionopen 
Platformx86OSWindowsOS Version7
Product Version6M62 
Target VersionFixed in Version 
Summary0002083: Containers holding concealed items do not show the " (empty)" detail text.
DescriptionSelf-explanatory. What's happening here is that the WriteAfterEntry routine uses child() to determine whether to write "(open)" or not for an open or transparent container. For container with only concealed items, the message is suppressed, but the routine then correctly refuses to write a contents list, so the end result is nothing gets printed.
Minimal Source Text To Reproduce
Home is a room.
The foo and the bar are containers in Home.
The baz is in the bar.

For deciding the concealed possessions of a container: if the particular possession is the baz, yes.
Additional InformationProposed fix: there's a visible-child check in WriteAfterEntry already. Simply moving it to before the start of the activity gives us the child_count, which can then substitute for the child() check:

[ WriteAfterEntry o depth
	p recurse_flag parenth_flag eldest_child child_count combo;

	inventory_stage = 2;
	child_count = 0;
	eldest_child = nothing;
	objectloop (p in o)
		if ((c_style & CONCEAL_BIT == 0) || (ConcealedFromLists(p) == false))
			if (p has list_filter_permits) {
				child_count++;
				if (eldest_child == nothing) eldest_child = p;
			}

	if (c_style & PARTINV_BIT) {
		BeginActivity(PRINTING_ROOM_DESC_DETAILS_ACT, o);
		if (ForActivity(PRINTING_ROOM_DESC_DETAILS_ACT, o) == false) {
			combo = 0;
			if (o has light && location hasnt light) combo=combo+1;
			if (o has container && o hasnt open)     combo=combo+2;
			if ((o has container && (o has open || o has transparent))) {
				if (child_count==0) {
					combo=combo+4;
				}
			}
			if (combo) LIST_WRITER_INTERNAL_RM('A'); ! space and open bracket
			switch (combo) {
				1: LIST_WRITER_INTERNAL_RM('D', o);
				2: LIST_WRITER_INTERNAL_RM('E', o);
				3: LIST_WRITER_INTERNAL_RM('H', o);
				4: LIST_WRITER_INTERNAL_RM('F', o);
				5: LIST_WRITER_INTERNAL_RM('I', o);
				6: LIST_WRITER_INTERNAL_RM('G', o);
				7: LIST_WRITER_INTERNAL_RM('J', o);
			}
			if (combo) LIST_WRITER_INTERNAL_RM('B'); ! close bracket
		}
		EndActivity(PRINTING_ROOM_DESC_DETAILS_ACT, o);
	}   ! end of PARTINV_BIT processing
	if (c_style & FULLINV_BIT) {
		BeginActivity(PRINTING_INVENTORY_DETAILS_ACT, o);
		if (ForActivity(PRINTING_INVENTORY_DETAILS_ACT, o) == false) {
			if (o has light && o has worn) { LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('K', 
o);  parenth_flag = true; }
			else {
				if (o has light)           { LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('D', o);  parenth_flag 
= true; }
				if (o has worn)            { LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('L', o); parenth_flag 
= true; }
			}
			if (o has container)
				if (o has openable) {
					if (parenth_flag) {
						#Ifdef SERIAL_COMMA; print ","; #Endif;
						LIST_WRITER_INTERNAL_RM('C');
					} else            LIST_WRITER_INTERNAL_RM('A', o);
					if (o has open)
						if (child(o)) LIST_WRITER_INTERNAL_RM('M', o);
						else          LIST_WRITER_INTERNAL_RM('N', o);
					else
						if (o has lockable && o has locked) LIST_WRITER_INTERNAL_RM('P', o);
						else                                LIST_WRITER_INTERNAL_RM('O', o);
					parenth_flag = true;
				}
				else
					if (child(o)==0 && o has transparent)
						if (parenth_flag) { LIST_WRITER_INTERNAL_RM('C'); LIST_WRITER_INTERNAL_RM('F'); }
						else              { LIST_WRITER_INTERNAL_RM('A'); LIST_WRITER_INTERNAL_RM('F'); LIST_WRITER_INTERNAL_RM('B'); 
}
	
			if (parenth_flag) LIST_WRITER_INTERNAL_RM('B');
		}
		EndActivity(PRINTING_INVENTORY_DETAILS_ACT, o);
	}   ! end of FULLINV_BIT processing

	if (child_count && (c_style & ALWAYS_BIT)) {
		if (c_style & ENGLISH_BIT) { print " "; LIST_WRITER_INTERNAL_RM('Q', o); print " 
"; }
		recurse_flag = true;
	}
	
	if (child_count && (c_style & RECURSE_BIT)) {
		if (o has supporter) {
			if (c_style & ENGLISH_BIT) {
				if (c_style & TERSE_BIT) {
					LIST_WRITER_INTERNAL_RM('A', o);
					LIST_WRITER_INTERNAL_RM('R', o);
				} else LIST_WRITER_INTERNAL_RM('S', o);
			}
			recurse_flag = true;
		}
		if (o has container && (o has open || o has transparent)) {
			if (c_style & ENGLISH_BIT) {
				if (c_style & TERSE_BIT) {
					LIST_WRITER_INTERNAL_RM('A', o);
					LIST_WRITER_INTERNAL_RM('T', o);
				} else LIST_WRITER_INTERNAL_RM('U', o);
			}
			recurse_flag = true;
		}
	}

	if (recurse_flag && (c_style & ENGLISH_BIT)) {
		SetLWI(child_count, -1, eldest_child);
		LIST_WRITER_INTERNAL_RM('V', o); print " ";
	}

	if (c_style & NEWLINE_BIT) new_line;

	if (recurse_flag) {
		o = child(o);
		@push lt_value; @push listing_together; @push listing_size;
		@push c_iterator;
		c_iterator = ObjectTreeIterator;
		lt_value = EMPTY_TEXT_VALUE; listing_together = 0; listing_size = 0;
		WriteListR(o, depth+1, true);
		@pull c_iterator;
		@pull listing_size; @pull listing_together; @pull lt_value;
		if (c_style & TERSE_BIT) LIST_WRITER_INTERNAL_RM('B');
	}
];
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships
related to 0002073new Both examine containers and examine supporters rules inconsistent when contents are concealed 

-  Notes
(0004821)
zarf (developer)
2018-12-16 15:59

Probably can be dealt with at the same time as http://inform7.com/mantis/view.php?id=2073 [^] .

- Issue History
Date Modified Username Field Change
2018-12-13 00:12 Eleas New Issue
2018-12-16 15:58 zarf Relationship added related to 0002073
2018-12-16 15:59 zarf Note Added: 0004821


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker